Merge changes from topics 'offline_operation_hours_part5', 'offline_operation_hours_part4' into nyc-mr1-dev

* changes:
  Show a static title/summary if country doesn't have support
  By default select current country in support phone list.
diff --git a/res/layout/redaction_interstitial.xml b/res/layout/redaction_interstitial.xml
index 1aa8af4..d1ce0dc 100644
--- a/res/layout/redaction_interstitial.xml
+++ b/res/layout/redaction_interstitial.xml
@@ -31,6 +31,7 @@
         android:orientation="vertical">
 
         <TextView
+            android:id="@+id/message"
             style="@style/SuwDescription.Glif"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
diff --git a/res/layout/storage_summary.xml b/res/layout/storage_summary.xml
index 35201e1..7bc51df 100644
--- a/res/layout/storage_summary.xml
+++ b/res/layout/storage_summary.xml
@@ -33,7 +33,7 @@
         android:singleLine="true"
         android:textAlignment="viewStart"
         android:textAppearance="@android:style/TextAppearance.Material.Subhead"
-        android:textColor="#ff607d8b"
+        android:textColor="?android:attr/colorAccent"
         android:textSize="36sp"
         android:ellipsize="marquee"
         android:fadingEdge="horizontal" />
diff --git a/src/com/android/settings/ConfirmDeviceCredentialBaseFragment.java b/src/com/android/settings/ConfirmDeviceCredentialBaseFragment.java
index ef19c2a..b46fa92 100644
--- a/src/com/android/settings/ConfirmDeviceCredentialBaseFragment.java
+++ b/src/com/android/settings/ConfirmDeviceCredentialBaseFragment.java
@@ -142,8 +142,16 @@
     @Override
     public void onResume() {
         super.onResume();
+        refreshLockScreen();
+    }
+
+    protected void refreshLockScreen() {
         if (mAllowFpAuthentication) {
             mFingerprintHelper.startListening();
+        } else {
+            if (mFingerprintHelper.isListening()) {
+                mFingerprintHelper.stopListening();
+            }
         }
         if (isProfileChallenge()) {
             updateErrorMessage(mLockPatternUtils.getCurrentFailedPasswordAttempts(
@@ -168,7 +176,7 @@
     @Override
     public void onPause() {
         super.onPause();
-        if (mAllowFpAuthentication) {
+        if (mFingerprintHelper.isListening()) {
             mFingerprintHelper.stopListening();
         }
     }
diff --git a/src/com/android/settings/ConfirmLockPattern.java b/src/com/android/settings/ConfirmLockPattern.java
index dd8640c..a2ce154 100644
--- a/src/com/android/settings/ConfirmLockPattern.java
+++ b/src/com/android/settings/ConfirmLockPattern.java
@@ -498,6 +498,7 @@
                 checkForPendingIntent();
             } else {
                 if (timeoutMs > 0) {
+                    refreshLockScreen();
                     long deadline = mLockPatternUtils.setLockoutAttemptDeadline(
                             effectiveUserId, timeoutMs);
                     handleAttemptLockout(deadline);
diff --git a/src/com/android/settings/dashboard/SupportFragment.java b/src/com/android/settings/dashboard/SupportFragment.java
index b4447cc..58f79a8 100644
--- a/src/com/android/settings/dashboard/SupportFragment.java
+++ b/src/com/android/settings/dashboard/SupportFragment.java
@@ -88,8 +88,8 @@
         mAccountManager = AccountManager.get(mActivity);
         mSupportFeatureProvider =
                 FeatureFactory.getFactory(mActivity).getSupportFeatureProvider(mActivity);
-        mSupportItemAdapter = new SupportItemAdapter(mActivity, mSupportFeatureProvider,
-                this /* itemClickListener */);
+        mSupportItemAdapter = new SupportItemAdapter(mActivity, savedInstanceState,
+                mSupportFeatureProvider, this /* itemClickListener */);
         mConnectivityManager =
                 (ConnectivityManager) mActivity.getSystemService(Context.CONNECTIVITY_SERVICE);
     }
@@ -130,6 +130,12 @@
     }
 
     @Override
+    public void onSaveInstanceState(Bundle outState) {
+        super.onSaveInstanceState(outState);
+        mSupportItemAdapter.onSaveInstanceState(outState);
+    }
+
+    @Override
     public void onAccountsUpdated(Account[] accounts) {
         // Account changed, update support items.
         mSupportItemAdapter.setAccount(
diff --git a/src/com/android/settings/dashboard/SupportItemAdapter.java b/src/com/android/settings/dashboard/SupportItemAdapter.java
index cba956e..03b9fe7 100644
--- a/src/com/android/settings/dashboard/SupportItemAdapter.java
+++ b/src/com/android/settings/dashboard/SupportItemAdapter.java
@@ -23,6 +23,7 @@
 import android.app.DialogFragment;
 import android.content.Context;
 import android.content.Intent;
+import android.os.Bundle;
 import android.support.v7.widget.RecyclerView;
 import android.text.TextUtils;
 import android.view.LayoutInflater;
@@ -54,6 +55,7 @@
  */
 public final class SupportItemAdapter extends RecyclerView.Adapter<SupportItemAdapter.ViewHolder> {
 
+    private static final String STATE_SELECTED_COUNTRY = "STATE_SELECTED_COUNTRY";
     private static final int TYPE_TITLE = R.layout.support_item_title;
     private static final int TYPE_ESCALATION_OPTIONS = R.layout.support_escalation_options;
     private static final int TYPE_ESCALATION_OPTIONS_OFFLINE =
@@ -72,8 +74,8 @@
     private boolean mHasInternet;
     private Account mAccount;
 
-    public SupportItemAdapter(Activity activity, SupportFeatureProvider supportFeatureProvider,
-            View.OnClickListener itemClickListener) {
+    public SupportItemAdapter(Activity activity, Bundle savedInstanceState,
+            SupportFeatureProvider supportFeatureProvider, View.OnClickListener itemClickListener) {
         mActivity = activity;
         mSupportFeatureProvider = supportFeatureProvider;
         mItemClickListener = itemClickListener;
@@ -82,6 +84,9 @@
         mSupportData = new ArrayList<>();
         // Optimistically assume we have Internet access. It will be updated later to correct value.
         mHasInternet = true;
+        if (savedInstanceState != null) {
+            mSelectedCountry = savedInstanceState.getString(STATE_SELECTED_COUNTRY);
+        }
         setAccount(mSupportFeatureProvider.getSupportEligibleAccount(mActivity));
         mSelectedCountry = mSupportFeatureProvider.getCurrentCountryCodeIfHasConfig(PHONE);
         refreshData();
@@ -151,6 +156,10 @@
         }
     }
 
+    public void onSaveInstanceState(Bundle outState) {
+        outState.putString(STATE_SELECTED_COUNTRY, mSelectedCountry);
+    }
+
     /**
      * Create data for the adapter. If there is already data in the adapter, they will be
      * destroyed and recreated.
diff --git a/src/com/android/settings/deviceinfo/StorageSummaryPreference.java b/src/com/android/settings/deviceinfo/StorageSummaryPreference.java
index 9fc1363..e1cf774 100644
--- a/src/com/android/settings/deviceinfo/StorageSummaryPreference.java
+++ b/src/com/android/settings/deviceinfo/StorageSummaryPreference.java
@@ -46,6 +46,7 @@
         if (mPercent != -1) {
             progress.setVisibility(View.VISIBLE);
             progress.setProgress(mPercent);
+            progress.setScaleY(7f);
         } else {
             progress.setVisibility(View.GONE);
         }
diff --git a/src/com/android/settings/fingerprint/FingerprintUiHelper.java b/src/com/android/settings/fingerprint/FingerprintUiHelper.java
index 6e7f8ec..f7ec97b 100644
--- a/src/com/android/settings/fingerprint/FingerprintUiHelper.java
+++ b/src/com/android/settings/fingerprint/FingerprintUiHelper.java
@@ -67,7 +67,7 @@
         }
     }
 
-    private boolean isListening() {
+    public boolean isListening() {
         return mCancellationSignal != null && !mCancellationSignal.isCanceled();
     }