diff options
author | jt1134 <jt1134@gmail.com> | 2012-06-06 23:03:02 -0500 |
---|---|---|
committer | jt1134 <jt1134@gmail.com> | 2012-06-06 23:03:02 -0500 |
commit | fbc38494060fc961b10b7cc8f0da9b3f902a66a0 (patch) | |
tree | cc918a72e7f43a5303624d309628acba08db8976 /AriesParts | |
parent | 324010079d2f8e4992d79d6b1d20f58a9347c992 (diff) | |
download | device_samsung_aries-common-fbc38494060fc961b10b7cc8f0da9b3f902a66a0.zip device_samsung_aries-common-fbc38494060fc961b10b7cc8f0da9b3f902a66a0.tar.gz device_samsung_aries-common-fbc38494060fc961b10b7cc8f0da9b3f902a66a0.tar.bz2 |
AriesParts: completely disable HSPA category on unsupported devices
Change-Id: I7e5e829f1c407b6848da11b33248ccbdda18fe4b
Diffstat (limited to 'AriesParts')
-rw-r--r-- | AriesParts/res/xml/main.xml | 3 | ||||
-rw-r--r-- | AriesParts/src/com/cyanogenmod/settings/device/DeviceSettings.java | 10 |
2 files changed, 10 insertions, 3 deletions
diff --git a/AriesParts/res/xml/main.xml b/AriesParts/res/xml/main.xml index c371a4f..7f88321 100644 --- a/AriesParts/res/xml/main.xml +++ b/AriesParts/res/xml/main.xml @@ -31,7 +31,8 @@ </PreferenceCategory> <PreferenceCategory - android:title="@string/category_radio_title"> + android:title="@string/category_radio_title" + android:key="category_radio"> <!-- UMTS/HSDPA/HSUPA settings --> <ListPreference android:key="hspa" diff --git a/AriesParts/src/com/cyanogenmod/settings/device/DeviceSettings.java b/AriesParts/src/com/cyanogenmod/settings/device/DeviceSettings.java index 466feeb..1eb677b 100644 --- a/AriesParts/src/com/cyanogenmod/settings/device/DeviceSettings.java +++ b/AriesParts/src/com/cyanogenmod/settings/device/DeviceSettings.java @@ -18,6 +18,7 @@ public class DeviceSettings extends PreferenceActivity { public static final String KEY_MDNIE = "mdnie"; public static final String KEY_BACKLIGHT_TIMEOUT = "backlight_timeout"; public static final String KEY_HSPA = "hspa"; + public static final String KEY_HSPA_CATEGORY = "category_radio"; public static final String KEY_TVOUT_ENABLE = "tvout_enable"; public static final String KEY_TVOUT_SYSTEM = "tvout_system"; public static final String KEY_VOLUME_BOOST = "volume_boost"; @@ -59,8 +60,13 @@ public class DeviceSettings extends PreferenceActivity { mBacklightTimeout.setOnPreferenceChangeListener(new TouchKeyBacklightTimeout()); mHspa = (ListPreference) findPreference(KEY_HSPA); - mHspa.setEnabled(Hspa.isSupported()); - mHspa.setOnPreferenceChangeListener(new Hspa(this)); + if (Hspa.isSupported()) { + mHspa.setOnPreferenceChangeListener(new Hspa(this)); + } else { + PreferenceCategory category = (PreferenceCategory) getPreferenceScreen().findPreference(KEY_HSPA_CATEGORY); + category.removePreference(mHspa); + getPreferenceScreen().removePreference(category); + } mVolumeBoost = (VolumeBoostPreference) findPreference(KEY_VOLUME_BOOST); if (!VolumeBoostPreference.isSupported()) { |