Display enhanced 4G LTE mode menu if needs
This menu doesn't need for all phones.
If needs, enable enhanced 4G LTE mode menu.
Bug:16966079
Change-Id: I3c104719a9f077fc9cbab4ee9e5f0230067670a3
diff --git a/res/values/config.xml b/res/values/config.xml
index cc0cf1a..0d1ae54 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -120,6 +120,8 @@
<bool name="config_enabled_lte" translatable="false">false</bool>
<!-- Show cdma auto network mode in (glabal) roaming -->
<bool name="config_show_cdma" translatable="false">false</bool>
+ <!-- Display enhanced 4G LTE mode menu if true -->
+ <bool name="config_enhanced_4g_lte_mode_enable" translatable="false">true</bool>
<!-- Package name for the default in-call UI and dialer [DO NOT TRANSLATE] -->
<string name="ui_default_package" translatable="false">com.android.dialer</string>
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
index 7359f76..637b429 100644
--- a/src/com/android/phone/MobileNetworkSettings.java
+++ b/src/com/android/phone/MobileNetworkSettings.java
@@ -341,6 +341,16 @@
android.util.Log.d(LOG_TAG, "keep ltePref");
}
+ // Enable enhanced 4G LTE mode settings depending on the value in config.xml
+ final boolean isEnhanced4GLteModeEnabled = getResources().getBoolean(
+ R.bool.config_enhanced_4g_lte_mode_enable);
+ if (!isEnhanced4GLteModeEnabled) {
+ Preference pref = prefSet.findPreference(BUTTON_4G_LTE_KEY);
+ if (pref != null) {
+ prefSet.removePreference(pref);
+ }
+ }
+
ActionBar actionBar = getActionBar();
if (actionBar != null) {
// android.R.id.home will be triggered in onOptionsItemSelected()