Merge "Show operation hours for selected country's support phone" into nyc-mr1-dev
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 09ded68..017b33f 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -7514,7 +7514,7 @@
     <string name="support_escalation_summary">Our support team is here to address any issues</string>
 
     <!-- Summary text for connecting to 24/7 customer support [CHAR LIMIT=NONE]-->
-    <string name="support_escalation_24_7_summary">Our support team is here all day, every day</string>
+    <string name="support_escalation_24_7_summary">Our support team is available all day, every day</string>
 
     <!-- Summary text when customer support is closed. [CHAR LIMIT=NONE]-->
     <string name="support_escalation_closed_summary">Call us during support hours (local time)&lt;br&gt;&lt;b&gt;<xliff:g id="operation_hours">%s</xliff:g>&lt;/b&gt;</string>
@@ -7535,11 +7535,8 @@
         <xliff:g id="language" example="English">%s</xliff:g> (<xliff:g id="phone" example="800-000-0000">%s</xliff:g>)
     </string>
 
-    <!-- Title text that indicates there is not internet connection. [CHAR LIMIT=80]-->
-    <string name="support_offline_title">You\'re offline</string>
-
-    <!-- Summary text telling user to connect to Internet in order to request customer support. [CHAR LIMIT=NONE]-->
-    <string name="support_offline_summary">To reach support, first connect to Wi-Fi or data.</string>
+    <!-- Title text for support options when there is no internet access. [CHAR LIMIT=80]-->
+    <string name="support_offline_title">Call us toll-free</string>
 
     <!-- Title text for a list of international support phone numbers. [CHAR LIMIT=60]-->
     <string name="support_international_phone_title">Traveling aboard?</string>
diff --git a/src/com/android/settings/dashboard/SupportItemAdapter.java b/src/com/android/settings/dashboard/SupportItemAdapter.java
index f1950a1..4f8a068 100644
--- a/src/com/android/settings/dashboard/SupportItemAdapter.java
+++ b/src/com/android/settings/dashboard/SupportItemAdapter.java
@@ -177,8 +177,8 @@
     }
 
     private void addEscalationCards() {
-        if (mSupportFeatureProvider.isAlwaysOperating(PHONE)
-                || mSupportFeatureProvider.isAlwaysOperating(CHAT)) {
+        if (mSupportFeatureProvider.isAlwaysOperating(PHONE, null /* countryCode */)
+                || mSupportFeatureProvider.isAlwaysOperating(CHAT, null /* countryCode */)) {
             mSupportData.add(new SupportData.Builder(mActivity, TYPE_TITLE)
                     .setText1(R.string.support_escalation_24_7_title)
                     .setText2(mActivity.getString(R.string.support_escalation_24_7_summary))
@@ -192,7 +192,7 @@
         } else {
             mSupportData.add(new SupportData.Builder(mActivity, TYPE_TITLE)
                     .setText1(R.string.support_escalation_closed_title)
-                    .setText2(mSupportFeatureProvider.getOperationHours(mActivity, PHONE))
+                    .setText2(mSupportFeatureProvider.getOperationHours(mActivity, PHONE, null))
                     .build());
         }
         final SupportData.Builder builder =
@@ -211,9 +211,16 @@
     }
 
     private void addOfflineEscalationCards() {
+        final CharSequence operatingHours;
+        if (mSupportFeatureProvider.isAlwaysOperating(PHONE, mSelectedCountry)) {
+            operatingHours = mActivity.getString(R.string.support_escalation_24_7_summary);
+        } else {
+            operatingHours = mSupportFeatureProvider.getOperationHours(mActivity,
+                    PHONE, mSelectedCountry);
+        }
         mSupportData.add(new SupportData.Builder(mActivity, TYPE_TITLE)
                 .setText1(R.string.support_offline_title)
-                .setText2(R.string.support_offline_summary)
+                .setText2(operatingHours)
                 .build());
         final OfflineSupportData.Builder builder = new OfflineSupportData.Builder(mActivity);
         builder.setCountries(mSupportFeatureProvider.getPhoneSupportCountries())
diff --git a/src/com/android/settings/overlay/SupportFeatureProvider.java b/src/com/android/settings/overlay/SupportFeatureProvider.java
index df066ea..75f5269 100644
--- a/src/com/android/settings/overlay/SupportFeatureProvider.java
+++ b/src/com/android/settings/overlay/SupportFeatureProvider.java
@@ -52,9 +52,10 @@
     boolean isSupportTypeEnabled(Context context, @SupportType int type);
 
     /**
-     * Whether or not a support type is in operation 24/7.
+     * Whether or not a support type is in operation 24/7. If country is null, use
+     * current country.
      */
-    boolean isAlwaysOperating(@SupportType int type);
+    boolean isAlwaysOperating(@SupportType int type, String countryCode);
 
     /**
      * Whether or not a support type is operating now.
@@ -62,16 +63,16 @@
     boolean isOperatingNow(@SupportType int type);
 
     /**
-     * Returns localized string for operation hours.
+     * Returns localized string for operation hours in specified country. If country is null, use
+     * current country to figure out operation hours.
      */
-    CharSequence getOperationHours(Context context, @SupportType int type);
+    CharSequence getOperationHours(Context context, @SupportType int type, String countryCode);
 
     /**
      * Returns a localized string indicating estimated wait time for a support time.
      */
     String getEstimatedWaitTime(Context context, @SupportType int type);
 
-
     /**
      * Returns a list of country codes that have phone support.
      */