In MobileNetworkSettings, add divider and "Advanced" button.
Setting style of PreferenceCategory to be the one with divider
above it. Manually add divider above APN preference. Added
expandable "Advanced" button to hide most preferences by default.
Bug: 63133738
Test: Manual
Change-Id: Ied9c025ab7288505262ba0c0222246ee74b30ef2
diff --git a/src/com/android/phone/GsmUmtsOptions.java b/src/com/android/phone/GsmUmtsOptions.java
index 697fca8..909e9bd 100644
--- a/src/com/android/phone/GsmUmtsOptions.java
+++ b/src/com/android/phone/GsmUmtsOptions.java
@@ -35,13 +35,15 @@
public class GsmUmtsOptions {
private static final String LOG_TAG = "GsmUmtsOptions";
- private PreferenceScreen mButtonAPNExpand;
+ private Preference mButtonAPNExpand;
+ private Preference mCategoryAPNExpand;
private TwoStatePreference mButtonAutoSelect;
private NetworkSelectListPreference mButtonOperatorSelection;
private NetworkOperators mNetworkOperator;
private static final String BUTTON_APN_EXPAND_KEY = "button_apn_key";
+ private static final String CATEGORY_APN_EXPAND_KEY = "category_apn_key";
private static final String BUTTON_CARRIER_SETTINGS_KEY = "carrier_settings_key";
public static final String EXTRA_SUB_ID = "sub_id";
@@ -61,7 +63,8 @@
protected void create() {
mPrefFragment.addPreferencesFromResource(R.xml.gsm_umts_options);
- mButtonAPNExpand = (PreferenceScreen) mPrefScreen.findPreference(BUTTON_APN_EXPAND_KEY);
+ mButtonAPNExpand = mPrefScreen.findPreference(BUTTON_APN_EXPAND_KEY);
+ mCategoryAPNExpand = mPrefScreen.findPreference(CATEGORY_APN_EXPAND_KEY);
mNetworkOperator = (NetworkOperators) mPrefScreen
.findPreference(NetworkOperators.CATEGORY_NETWORK_OPERATORS_KEY);
@@ -71,7 +74,7 @@
boolean removedNetworkOperatorsCategory = false;
if (PhoneFactory.getDefaultPhone().getPhoneType() != PhoneConstants.PHONE_TYPE_GSM) {
log("Not a GSM phone");
- mButtonAPNExpand.setEnabled(false);
+ mCategoryAPNExpand.setEnabled(false);
mNetworkOperator.setEnabled(false);
} else {
log("Not a CDMA phone");
@@ -85,8 +88,7 @@
// Note: these settings used to be controlled with overlays in
// Telephony/res/values/config.xml
if (!carrierConfig.getBoolean(CarrierConfigManager.KEY_APN_EXPAND_BOOL)
- && mButtonAPNExpand != null) {
- mPrefScreen.removePreference(mButtonAPNExpand);
+ && mCategoryAPNExpand != null) {
removedAPNExpand = true;
}
if (!carrierConfig.getBoolean(
@@ -134,6 +136,8 @@
return true;
}
});
+ } else {
+ mPrefScreen.removePreference(mCategoryAPNExpand);
}
if (!removedNetworkOperatorsCategory) {