Merge "Workaround to hide LTE wording for O2" into pi-dev
diff --git a/res/values-hr/strings.xml b/res/values-hr/strings.xml
index 76c97cf..e21bf03 100644
--- a/res/values-hr/strings.xml
+++ b/res/values-hr/strings.xml
@@ -519,7 +519,7 @@
     <string name="dial_emergency_calling_not_available" msgid="5675557523782491826">"Hitni pozivi nisu dostupni"</string>
     <string name="police_type_description" msgid="5324410799919829693">"Policija"</string>
     <string name="ambulance_type_description" msgid="4114815025408089866">"Hitna pomoć"</string>
-    <string name="fire_type_description" msgid="7145996705197064710">"Vatra"</string>
+    <string name="fire_type_description" msgid="7145996705197064710">"Vatrogasci"</string>
     <string name="description_concat_format" msgid="7141070875487870177">"%1$s, %2$s"</string>
     <string name="dialerKeyboardHintText" msgid="9192914825413747792">"Birajte pomoću tipkovnice"</string>
     <string name="onscreenHoldText" msgid="2285258239691145872">"Na čekanju"</string>
diff --git a/res/values-hy/strings.xml b/res/values-hy/strings.xml
index 93010f0..645f685 100644
--- a/res/values-hy/strings.xml
+++ b/res/values-hy/strings.xml
@@ -275,11 +275,11 @@
     <!-- String.format failed for translation -->
     <!-- no translation found for throttle_data_usage_subtext (6029276011123694701) -->
     <skip />
-    <string name="throttle_data_rate_reduced_subtext" msgid="7492763592720107737">"<xliff:g id="USED_0">%1$s</xliff:g> առավելագույնը գերազանցվել է\nՏվյալների արժեքը նվազել է մինչև <xliff:g id="USED_1">%2$d</xliff:g> կբիթ/վ"</string>
+    <string name="throttle_data_rate_reduced_subtext" msgid="7492763592720107737">"<xliff:g id="USED_0">%1$s</xliff:g> առավելագույնը գերազանցվել է\nՏվյալների արժեքը նվազել է մինչև <xliff:g id="USED_1">%2$d</xliff:g> Կբիթ/վ"</string>
     <!-- String.format failed for translation -->
     <!-- no translation found for throttle_time_frame_subtext (7732763021560399960) -->
     <skip />
-    <string name="throttle_rate_subtext" msgid="2149102656120726855">"Տվյալների ծավալը կնվազի մինչև <xliff:g id="USED">%1$d</xliff:g> կբիթ/վ, եթե տվյալների օգտագործման սահմանաչափը գերազանցվի"</string>
+    <string name="throttle_rate_subtext" msgid="2149102656120726855">"Տվյալների ծավալը կնվազի մինչև <xliff:g id="USED">%1$d</xliff:g> Կբիթ/վ, եթե տվյալների օգտագործման սահմանաչափը գերազանցվի"</string>
     <string name="throttle_help_subtext" msgid="5217706521499010816">"Լրացուցիչ տեղեկություններ ձեր սպասարկողի բջջային ցանցի տվյալների օգտագործման քաղաքականության մասին"</string>
     <string name="cell_broadcast_sms" msgid="5584192824053625842">"Բջջային հեռարձակման SMS"</string>
     <string name="enable_disable_cell_bc_sms" msgid="4851147873691392255">"Բջջային հեռարձակման SMS"</string>
diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml
index b475649..0a5f683 100644
--- a/res/values-ko/strings.xml
+++ b/res/values-ko/strings.xml
@@ -483,7 +483,7 @@
     <string name="notification_voicemail_no_vm_number" msgid="760963466895609716">"알 수 없는 음성사서함 번호"</string>
     <string name="notification_network_selection_title" msgid="4224455487793492772">"서비스 불가"</string>
     <string name="notification_network_selection_text" msgid="2607085729661923269">"선택한 네트워크(<xliff:g id="OPERATOR_NAME">%s</xliff:g>)를 사용할 수 없음"</string>
-    <string name="incall_error_power_off" product="watch" msgid="2007450435656211658">"전화를 걸려면 모바일 네트워크를 사용 설정하고 비행기 모드 또는 배터리 세이버 모드를 사용 중지하세요."</string>
+    <string name="incall_error_power_off" product="watch" msgid="2007450435656211658">"전화를 걸려면 모바일 네트워크를 사용 설정하고 비행기 모드 또는 절전 모드를 사용 중지하세요."</string>
     <string name="incall_error_power_off" product="default" msgid="2947938060513306698">"전화를 걸려면 비행기 모드를 사용 중지하세요."</string>
     <string name="incall_error_power_off_wfc" msgid="8711428920632416575">"전화를 걸려면 비행기 모드를 사용 중지하거나 무선 네트워크에 연결하세요."</string>
     <string name="incall_error_ecm_emergency_only" msgid="738708660612388692">"일반 전화를 걸려면 긴급 콜백 모드를 해제하세요."</string>
diff --git a/res/values-vi/strings.xml b/res/values-vi/strings.xml
index aaf84b1..1d67637 100644
--- a/res/values-vi/strings.xml
+++ b/res/values-vi/strings.xml
@@ -385,7 +385,7 @@
   </string-array>
     <string name="cdma_activate_device" msgid="3793805892364814518">"Kích hoạt thiết bị"</string>
     <string name="cdma_lte_data_service" msgid="4255018217292548962">"Thiết lập dịch vụ dữ liệu"</string>
-    <string name="carrier_settings_title" msgid="9028166176523012300">"Cài đặt nhà cung cấp dịch vụ"</string>
+    <string name="carrier_settings_title" msgid="9028166176523012300">"Cài đặt nhà mạng"</string>
     <string name="fdn" msgid="7878832555095183202">"Số gọi định sẵn"</string>
     <string name="fdn_with_label" msgid="187084204115493366">"Số gọi định sẵn (<xliff:g id="SUBSCRIPTIONLABEL">%s</xliff:g>)"</string>
     <string name="manage_fdn_list" msgid="8777755791892122369">"Danh sách FDN"</string>
diff --git a/src/com/android/phone/EmergencyDialer.java b/src/com/android/phone/EmergencyDialer.java
index db4fcd2..b7d10bd 100644
--- a/src/com/android/phone/EmergencyDialer.java
+++ b/src/com/android/phone/EmergencyDialer.java
@@ -209,6 +209,9 @@
 
     private static final int BAD_EMERGENCY_NUMBER_DIALOG = 0;
 
+    /** 90% opacity, different from other gradients **/
+    private static final int BACKGROUND_GRADIENT_ALPHA = 230;
+
     /** 85% opacity for black background **/
     private static final int BLACK_BACKGROUND_GRADIENT_ALPHA = 217;
 
@@ -281,6 +284,8 @@
     private boolean mIsWfcEmergencyCallingWarningEnabled;
     private float mDefaultDigitsTextSize;
 
+    private boolean mAreEmergencyDialerShortcutsEnabled;
+
     private MetricsWriter mMetricsWriter;
     private SensorManager mSensorManager;
     private Sensor mProximitySensor;
@@ -347,11 +352,21 @@
 
         getWindow().setAttributes(lp);
 
+        mAreEmergencyDialerShortcutsEnabled = false;
+        Log.d(LOG_TAG, "Enable emergency dialer shortcut: "
+                + mAreEmergencyDialerShortcutsEnabled);
+
         mColorExtractor = new ColorExtractor(this);
 
         // It does not support dark text theme, when emergency dialer shortcuts are enabled.
         // And the background color is black with 85% opacity.
-        updateTheme(false);
+        if (mAreEmergencyDialerShortcutsEnabled) {
+            updateTheme(false);
+        } else {
+            GradientColors lockScreenColors = mColorExtractor.getColors(WallpaperManager.FLAG_LOCK,
+                    ColorExtractor.TYPE_EXTRA_DARK);
+            updateTheme(lockScreenColors.supportsDarkText());
+        }
 
         setContentView(R.layout.emergency_dialer);
 
@@ -369,7 +384,8 @@
         ((WindowManager) getSystemService(Context.WINDOW_SERVICE))
                 .getDefaultDisplay().getSize(displaySize);
         mBackgroundGradient.setScreenSize(displaySize.x, displaySize.y);
-        mBackgroundGradient.setAlpha(BLACK_BACKGROUND_GRADIENT_ALPHA);
+        mBackgroundGradient.setAlpha(mAreEmergencyDialerShortcutsEnabled
+                ? BLACK_BACKGROUND_GRADIENT_ALPHA : BACKGROUND_GRADIENT_ALPHA);
         getWindow().setBackgroundDrawable(mBackgroundGradient);
 
         // Check for the presence of the keypad
@@ -437,8 +453,10 @@
 
         mEmergencyInfoGroup = (EmergencyInfoGroup) findViewById(R.id.emergency_info_button);
 
-        mEccInfoHelper = new EccInfoHelper(new IsoToEccProtobufRepository());
-        setupEmergencyShortcutsView();
+        if (mAreEmergencyDialerShortcutsEnabled) {
+            mEccInfoHelper = new EccInfoHelper(new IsoToEccProtobufRepository());
+            setupEmergencyShortcutsView();
+        }
     }
 
     @Override
@@ -503,7 +521,8 @@
         // If emergency dialer shortcut is enabled and Dialpad view is visible, pressing the
         // back key will back to display EmergencyShortcutView view.
         // Otherwise, it would finish the activity.
-        if (mDialpadView != null && mDialpadView.getVisibility() == View.VISIBLE) {
+        if (mAreEmergencyDialerShortcutsEnabled && mDialpadView != null
+                && mDialpadView.getVisibility() == View.VISIBLE) {
             switchView(mEmergencyShortcutView, mDialpadView, true);
             return;
         }
@@ -723,10 +742,21 @@
         mUserActions = MetricsWriter.USER_ACTION_NONE;
         mMetricsWriter.writeMetricsForEnter();
 
-        mBackgroundGradient.setColors(Color.BLACK, Color.BLACK, false);
-        updateTheme(false);
+        // It does not support dark text theme, when emergency dialer shortcuts are enabled.
+        // And set background color to black.
+        if (mAreEmergencyDialerShortcutsEnabled) {
+            mBackgroundGradient.setColors(Color.BLACK, Color.BLACK, false);
+            updateTheme(false);
+        } else {
+            mColorExtractor.addOnColorsChangedListener(this);
+            GradientColors lockScreenColors = mColorExtractor.getColors(WallpaperManager.FLAG_LOCK,
+                    ColorExtractor.TYPE_EXTRA_DARK);
+            // Do not animate when view isn't visible yet, just set an initial state.
+            mBackgroundGradient.setColors(lockScreenColors, false);
+            updateTheme(lockScreenColors.supportsDarkText());
+        }
 
-        if (mEccInfoHelper != null) {
+        if (mAreEmergencyDialerShortcutsEnabled && mEccInfoHelper != null) {
             final Context context = this;
             mEccInfoHelper.getCountryEccInfoAsync(context,
                     new EccInfoHelper.CountryEccInfoResultCallback() {