diff options
Diffstat (limited to 'CrespoParts/src/com/cyanogenmod/settings/device/TouchKeyBacklightTimeout.java')
-rw-r--r-- | CrespoParts/src/com/cyanogenmod/settings/device/TouchKeyBacklightTimeout.java | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/CrespoParts/src/com/cyanogenmod/settings/device/TouchKeyBacklightTimeout.java b/CrespoParts/src/com/cyanogenmod/settings/device/TouchKeyBacklightTimeout.java deleted file mode 100644 index e1f06c7..0000000 --- a/CrespoParts/src/com/cyanogenmod/settings/device/TouchKeyBacklightTimeout.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.cyanogenmod.settings.device; - -import android.content.Context; -import android.content.SharedPreferences; -import android.preference.Preference; -import android.preference.Preference.OnPreferenceChangeListener; -import android.preference.PreferenceManager; - -public class TouchKeyBacklightTimeout implements OnPreferenceChangeListener { - - private static final String FILE = "/sys/class/misc/notification/bl_timeout"; - - public static boolean isSupported() { - return Utils.fileExists(FILE); - } - - /** - * Restore backlight timeout setting from SharedPreferences. (Write to kernel.) - * @param context The context to read the SharedPreferences from - */ - public static void restore(Context context) { - if (!isSupported()) { - return; - } - - SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); - Utils.writeValue(FILE, sharedPrefs.getString(DeviceSettings.KEY_BACKLIGHT_TIMEOUT, "5")); - } - - @Override - public boolean onPreferenceChange(Preference preference, Object newValue) { - Utils.writeValue(FILE, (String) newValue); - return true; - } - -}
\ No newline at end of file |