Merge "Add Carrier Config to hide "Network default" option in Caller ID setting"
diff --git a/res/layout/emergency_shortcut_buttons_group.xml b/res/layout/emergency_shortcut_buttons_group.xml
index bafedd1..7911f30 100644
--- a/res/layout/emergency_shortcut_buttons_group.xml
+++ b/res/layout/emergency_shortcut_buttons_group.xml
@@ -38,7 +38,8 @@
                 android:ellipsize="end"
                 android:lineHeight="@dimen/emergency_number_title_line_height"
                 android:fontFamily="sans-serif-medium"
-                android:textAppearance="@style/SubtitleTextAppearance"
+                android:textColor="@android:color/white"
+                android:textSize="@dimen/emergency_number_title_text_size"
                 android:text="@string/single_emergency_number_title"/>
         </FrameLayout>
         <LinearLayout
@@ -63,7 +64,8 @@
                 android:maxLines="2"
                 android:ellipsize="end"
                 android:lineHeight="@dimen/location_text_line_height"
-                android:textAppearance="@style/SubtitleTextAppearance"/>
+                android:textColor="@android:color/white"
+                android:textSize="@dimen/emergency_location_text_size"/>
         </LinearLayout>
     </FrameLayout>
     <LinearLayout
diff --git a/res/values-sw345dp/dimens.xml b/res/values-sw345dp/dimens.xml
new file mode 100644
index 0000000..84db80b
--- /dev/null
+++ b/res/values-sw345dp/dimens.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2018 The Android Open Source Project
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License
+  -->
+
+<resources>
+    <dimen name="emergency_info_button_height">88dp</dimen>
+    <dimen name="emergency_info_button_margin_vertical">48dp</dimen>
+    <dimen name="emergency_shortcut_button_height">88dp</dimen>
+    <dimen name="emergency_number_title_text_size">12sp</dimen>
+    <dimen name="emergency_location_text_size">12sp</dimen>
+</resources>
\ No newline at end of file
diff --git a/res/values-sw360dp/dimens.xml b/res/values-sw360dp/dimens.xml
new file mode 100644
index 0000000..c578065
--- /dev/null
+++ b/res/values-sw360dp/dimens.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2018 The Android Open Source Project
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License
+  -->
+
+<resources>
+    <dimen name="emergency_info_button_height">96dp</dimen>
+    <dimen name="emergency_info_button_margin_vertical">56dp</dimen>
+    <dimen name="emergency_shortcut_button_height">96dp</dimen>
+    <dimen name="emergency_number_title_text_size">14sp</dimen>
+    <dimen name="emergency_location_text_size">14sp</dimen>
+</resources>
\ No newline at end of file
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index b657e64..38241de 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -128,8 +128,8 @@
     <dimen name="emergency_number_title_group_padding_horizontal">16dp</dimen>
 
     <!-- Height and vertical margin for the emergency information button. -->
-    <dimen name="emergency_info_button_height">96dp</dimen>
-    <dimen name="emergency_info_button_margin_vertical">56dp</dimen>
+    <dimen name="emergency_info_button_height">80dp</dimen>
+    <dimen name="emergency_info_button_margin_vertical">40dp</dimen>
     <dimen name="emergency_info_button_fix_margin_vertical">40dp</dimen>
 
     <!-- Margin for the emergency information button text. -->
@@ -155,7 +155,7 @@
     <dimen name="location_image_width">16dp</dimen>
 
     <!-- The height for button of emergency shortcut. -->
-    <dimen name="emergency_shortcut_button_height">96dp</dimen>
+    <dimen name="emergency_shortcut_button_height">80dp</dimen>
 
     <!-- The height and width for the circle image of phone number type.-->
     <dimen name="phone_number_type_circle_image_height">40dp</dimen>
@@ -197,4 +197,9 @@
     <!-- The width for emergency number title container.-->
     <dimen name="emergency_number_title_container_width">210dp</dimen>
 
+    <!-- The text size for emergency number title.-->
+    <dimen name="emergency_number_title_text_size">13sp</dimen>
+
+    <!-- The text size for emergency location.-->
+    <dimen name="emergency_location_text_size">13sp</dimen>
 </resources>
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
index 28b6497..125c01a 100644
--- a/src/com/android/phone/MobileNetworkSettings.java
+++ b/src/com/android/phone/MobileNetworkSettings.java
@@ -424,7 +424,7 @@
         CdmaOptions mCdmaOptions;
 
         private Preference mClickedPreference;
-        private boolean mShow4GForLTE = true;
+        private boolean mShow4GForLTE = false;
         private boolean mIsGlobalCdma;
         private boolean mOnlyAutoSelectInHomeNW;
         private boolean mUnavailable;
@@ -1209,7 +1209,7 @@
             final int phoneType = mTelephonyManager.getPhoneType();
             final PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(mSubId);
             mShow4GForLTE = carrierConfig != null ? carrierConfig.getBoolean(
-                    CarrierConfigManager.KEY_SHOW_4G_FOR_LTE_DATA_ICON_BOOL) : true;
+                    CarrierConfigManager.KEY_SHOW_4G_FOR_LTE_DATA_ICON_BOOL) : false;
             if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
                 final int lteForced = android.provider.Settings.Global.getInt(
                         getContext().getContentResolver(),
diff --git a/src/com/android/phone/NetworkSelectSetting.java b/src/com/android/phone/NetworkSelectSetting.java
index d0ab87a..248ecc1 100644
--- a/src/com/android/phone/NetworkSelectSetting.java
+++ b/src/com/android/phone/NetworkSelectSetting.java
@@ -84,7 +84,7 @@
     private NetworkOperatorPreference mSelectedNetworkOperatorPreference;
     private TelephonyManager mTelephonyManager;
     private List<String> mForbiddenPlmns;
-    private boolean mShow4GForLTE = true;
+    private boolean mShow4GForLTE = false;
     private NetworkScanHelper mNetworkScanHelper;
     private final ExecutorService mNetworkScanExecutor = Executors.newFixedThreadPool(1);
 
diff --git a/src/com/android/phone/settings/PhoneAccountSettingsFragment.java b/src/com/android/phone/settings/PhoneAccountSettingsFragment.java
index d891da9..670f98d 100644
--- a/src/com/android/phone/settings/PhoneAccountSettingsFragment.java
+++ b/src/com/android/phone/settings/PhoneAccountSettingsFragment.java
@@ -18,7 +18,6 @@
 import android.telecom.TelecomManager;
 import android.telephony.SubscriptionInfo;
 import android.telephony.SubscriptionManager;
-import android.telephony.SubscriptionManager.OnSubscriptionsChangedListener;
 import android.telephony.TelephonyManager;
 import android.text.TextUtils;
 import android.util.Log;
@@ -77,15 +76,6 @@
     private SwitchPreference mSipReceiveCallsPreference;
     private SipPreferences mSipPreferences;
 
-    private final SubscriptionManager.OnSubscriptionsChangedListener
-            mOnSubscriptionsChangeListener =
-            new SubscriptionManager.OnSubscriptionsChangedListener() {
-        @Override
-        public void onSubscriptionsChanged() {
-            updateAccounts();
-        }
-    };
-
     @Override
     public void onCreate(Bundle icicle) {
         super.onCreate(icicle);
@@ -132,8 +122,34 @@
          */
         mAccountList = (PreferenceCategory) getPreferenceScreen().findPreference(
                 ACCOUNTS_LIST_CATEGORY_KEY);
+        List<PhoneAccountHandle> allNonSimAccounts =
+                getCallingAccounts(false /* includeSims */, true /* includeDisabled */);
+        // Check to see if we should show the entire section at all.
+        if (shouldShowConnectionServiceList(allNonSimAccounts)) {
+            List<PhoneAccountHandle> enabledAccounts =
+                    getCallingAccounts(true /* includeSims */, false /* includeDisabled */);
+            // Initialize the account list with the set of enabled & SIM accounts.
+            initAccountList(enabledAccounts);
 
-        updateAccounts();
+            mDefaultOutgoingAccount = (AccountSelectionPreference)
+                    getPreferenceScreen().findPreference(DEFAULT_OUTGOING_ACCOUNT_KEY);
+            mDefaultOutgoingAccount.setListener(this);
+
+            // Only show the 'Make Calls With..." option if there are multiple accounts.
+            if (enabledAccounts.size() > 1) {
+                updateDefaultOutgoingAccountsModel();
+            } else {
+                mAccountList.removePreference(mDefaultOutgoingAccount);
+            }
+
+            Preference allAccounts = getPreferenceScreen().findPreference(ALL_CALLING_ACCOUNTS_KEY);
+            // If there are no third party (nonSim) accounts, then don't show enable/disable dialog.
+            if (allNonSimAccounts.isEmpty() && allAccounts != null) {
+                mAccountList.removePreference(allAccounts);
+            }
+        } else {
+            getPreferenceScreen().removePreference(mAccountList);
+        }
 
         if (isPrimaryUser() && SipUtil.isVoipSupported(getActivity())) {
             mSipPreferences = new SipPreferences(getActivity());
@@ -167,16 +183,6 @@
             getPreferenceScreen().removePreference(
                     getPreferenceScreen().findPreference(SIP_SETTINGS_CATEGORY_PREF_KEY));
         }
-
-        SubscriptionManager.from(getActivity()).addOnSubscriptionsChangedListener(
-                mOnSubscriptionsChangeListener);
-    }
-
-    @Override
-    public void onPause() {
-        SubscriptionManager.from(getActivity()).removeOnSubscriptionsChangedListener(
-                mOnSubscriptionsChangeListener);
-        super.onPause();
     }
 
     /**
@@ -385,40 +391,6 @@
         return mTelephonyManager.isMultiSimEnabled() || allNonSimAccounts.size() > 0;
     }
 
-    private void updateAccounts() {
-        if (mAccountList != null) {
-            mAccountList.removeAll();
-            List<PhoneAccountHandle> allNonSimAccounts =
-                    getCallingAccounts(false /* includeSims */, true /* includeDisabled */);
-            // Check to see if we should show the entire section at all.
-            if (shouldShowConnectionServiceList(allNonSimAccounts)) {
-                List<PhoneAccountHandle> enabledAccounts =
-                        getCallingAccounts(true /* includeSims */, false /* includeDisabled */);
-                // Initialize the account list with the set of enabled & SIM accounts.
-                initAccountList(enabledAccounts);
-
-                mDefaultOutgoingAccount = (AccountSelectionPreference)
-                        getPreferenceScreen().findPreference(DEFAULT_OUTGOING_ACCOUNT_KEY);
-                mDefaultOutgoingAccount.setListener(this);
-
-                // Only show the 'Make Calls With..." option if there are multiple accounts.
-                if (enabledAccounts.size() > 1) {
-                    updateDefaultOutgoingAccountsModel();
-                } else {
-                    mAccountList.removePreference(mDefaultOutgoingAccount);
-                }
-
-                Preference allAccounts = getPreferenceScreen().findPreference(ALL_CALLING_ACCOUNTS_KEY);
-                // If there are no third party (nonSim) accounts, then don't show enable/disable dialog.
-                if (allNonSimAccounts.isEmpty() && allAccounts != null) {
-                    mAccountList.removePreference(allAccounts);
-                }
-            } else {
-                getPreferenceScreen().removePreference(mAccountList);
-            }
-        }
-    }
-
     private List<PhoneAccountHandle> getCallingAccounts(
             boolean includeSims, boolean includeDisabledAccounts) {
         PhoneAccountHandle emergencyAccountHandle = getEmergencyPhoneAccount();