diff options
author | sbrissen <sbrissen@hotmail.com> | 2013-06-26 14:51:41 -0400 |
---|---|---|
committer | sbrissen <sbrissen@hotmail.com> | 2013-06-26 14:56:40 -0400 |
commit | 5d158f44a728e13b4e0bdd0eb76b53e9e2afd451 (patch) | |
tree | 6803aaa71e62e39957bd11171f9289b40d83a370 | |
parent | 8edc118366badac67985d55e0eaf5fe8b48fd331 (diff) | |
download | device_samsung_smdk4412-common-5d158f44a728e13b4e0bdd0eb76b53e9e2afd451.zip device_samsung_smdk4412-common-5d158f44a728e13b4e0bdd0eb76b53e9e2afd451.tar.gz device_samsung_smdk4412-common-5d158f44a728e13b4e0bdd0eb76b53e9e2afd451.tar.bz2 |
DeviceSettings: add more overlays
Devices such as t0ltevzw don't have hspa and the p4noteltevzw(tablet) doesn't
have touchkeys, so this will allow them to be disabled.
Change-Id: I5c37f84c9266289e50043e82193ce3d77fb072f1
3 files changed, 21 insertions, 1 deletions
diff --git a/DeviceSettings/res/values/config.xml b/DeviceSettings/res/values/config.xml index a42c049..5fdb6ac 100644 --- a/DeviceSettings/res/values/config.xml +++ b/DeviceSettings/res/values/config.xml @@ -43,4 +43,10 @@ <string name="audioout_default_value" translatable="false">50</string> <string name="audioout_min_value" translatable="false">0</string> + <!-- HSPA --> + <bool name="has_hspa">true</bool> + + <!-- Touchkey --> + <bool name="has_touchkey">true</bool> + </resources> diff --git a/DeviceSettings/src/com/cyanogenmod/settings/device/RadioFragmentActivity.java b/DeviceSettings/src/com/cyanogenmod/settings/device/RadioFragmentActivity.java index d094ef2..e4b1eda 100644 --- a/DeviceSettings/src/com/cyanogenmod/settings/device/RadioFragmentActivity.java +++ b/DeviceSettings/src/com/cyanogenmod/settings/device/RadioFragmentActivity.java @@ -17,6 +17,7 @@ package com.cyanogenmod.settings.device; import android.content.Context; +import android.content.res.Resources; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.CheckBoxPreference; @@ -35,6 +36,9 @@ public class RadioFragmentActivity extends PreferenceFragment { private static final String PREF_ENABLED = "1"; private static final String TAG = "DeviceSettings_Radio"; + private static boolean sHspa; + private Hspa mHspa; + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -42,7 +46,11 @@ public class RadioFragmentActivity extends PreferenceFragment { addPreferencesFromResource(R.xml.radio_preferences); PreferenceScreen prefSet = getPreferenceScreen(); + Resources res = getResources(); + sHspa = res.getBoolean(R.bool.has_hspa); + mHspa = (Hspa) findPreference(DeviceSettings.KEY_HSPA); + mHspa.setEnabled(sHspa); } @Override diff --git a/DeviceSettings/src/com/cyanogenmod/settings/device/ScreenFragmentActivity.java b/DeviceSettings/src/com/cyanogenmod/settings/device/ScreenFragmentActivity.java index 9efe06d..f5c33b5 100644 --- a/DeviceSettings/src/com/cyanogenmod/settings/device/ScreenFragmentActivity.java +++ b/DeviceSettings/src/com/cyanogenmod/settings/device/ScreenFragmentActivity.java @@ -41,8 +41,10 @@ public class ScreenFragmentActivity extends PreferenceFragment { private mDNIeMode mmDNIeMode; private mDNIeNegative mmDNIeNegative; private LedFade mLedFade; + private CheckBoxPreference mTouchKey; private static boolean sSPenSupported; + private static boolean sTouchkeySupport; private static final String FILE_TOUCHKEY_BRIGHTNESS = "/sys/class/sec/sec_touchkey/brightness"; private static final String FILE_TOUCHKEY_DISABLE = "/sys/class/sec/sec_touchkey/force_disable"; @@ -74,7 +76,11 @@ public class ScreenFragmentActivity extends PreferenceFragment { mLedFade.setEnabled(LedFade.isSupported()); /* Touchkey */ - if (((CheckBoxPreference)preferenceScreen.findPreference(DeviceSettings.KEY_TOUCHKEY_LIGHT)).isChecked()) { + sTouchkeySupport = res.getBoolean(R.bool.has_touchkey); + mTouchKey = (CheckBoxPreference)preferenceScreen.findPreference(DeviceSettings.KEY_TOUCHKEY_LIGHT); + mTouchKey.setEnabled(sTouchkeySupport); + + if (mTouchKey.isChecked() && mTouchKey.isEnabled()) { preferenceScreen.findPreference(DeviceSettings.KEY_TOUCHKEY_TIMEOUT).setEnabled(true); } else { preferenceScreen.findPreference(DeviceSettings.KEY_TOUCHKEY_TIMEOUT).setEnabled(false); |