summaryrefslogtreecommitdiffstats
path: root/DeviceSettings/src/com/cyanogenmod/settings/device/ScreenFragmentActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'DeviceSettings/src/com/cyanogenmod/settings/device/ScreenFragmentActivity.java')
-rw-r--r--DeviceSettings/src/com/cyanogenmod/settings/device/ScreenFragmentActivity.java8
1 files changed, 7 insertions, 1 deletions
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);