summaryrefslogtreecommitdiffstats
path: root/CrespoParts
diff options
context:
space:
mode:
authorRobert Burns <burnsra@gmail.com>2012-01-11 09:49:50 -0500
committerRobert Burns <burnsra@gmail.com>2012-01-11 11:09:06 -0500
commit472352ed57a466d1616ceb595863413731505873 (patch)
tree050c15479fdd7fa70fc56c364175154d6b2c165f /CrespoParts
parentf72fc292e8dd7bdbedcf88fd7e39c8da3fdd61f1 (diff)
downloaddevice_samsung_crespo-472352ed57a466d1616ceb595863413731505873.zip
device_samsung_crespo-472352ed57a466d1616ceb595863413731505873.tar.gz
device_samsung_crespo-472352ed57a466d1616ceb595863413731505873.tar.bz2
CrespoParts cleanup
- Provided ability to disable backlight notifications(BLN) - String cleanup - Removed obsolete files Change-Id: I36c6ae0749bb9e2f43e67356fba243ac8e3aa301
Diffstat (limited to 'CrespoParts')
-rw-r--r--CrespoParts/res/values/strings.xml4
-rw-r--r--CrespoParts/res/xml/general_preferences.xml37
-rw-r--r--CrespoParts/res/xml/main.xml58
-rw-r--r--CrespoParts/res/xml/wm8994_settings.xml72
-rw-r--r--CrespoParts/src/com/cyanogenmod/settings/device/DeviceSettings.java1
-rw-r--r--CrespoParts/src/com/cyanogenmod/settings/device/GeneralFragmentActivity.java31
6 files changed, 49 insertions, 154 deletions
diff --git a/CrespoParts/res/values/strings.xml b/CrespoParts/res/values/strings.xml
index 4355907..a1d2386 100644
--- a/CrespoParts/res/values/strings.xml
+++ b/CrespoParts/res/values/strings.xml
@@ -7,7 +7,7 @@
<string name="display_title">DISPLAY</string>
<string name="sound_title">SOUND</string>
- <string name="category_battery_title">Battery</string>
+ <string name="category_cpu_title">CPU</string>
<string name="cpu_deepidle_title_head">Deep Idle</string>
<string name="cpu_deepidle_summary_head">Enables deep idle, intended to provide better battery life. (Experimental at this time!)</string>
<string name="category_screen_title">WM8994 Settings ( voodoo )</string>
@@ -51,6 +51,8 @@
<string name="pref_wm8994_fll_tuning_summary">Use tuned WM8994 audio clock source -- improves quality of sound</string>
<string name="category_touchkey_title">Touch Keys</string>
+ <string name="touchkey_notification_title_head">Backlight Notifications</string>
+ <string name="touchkey_notification_summary_head">The touch key backlights will turn on when there is a notification.</string>
<string name="backlight_timeout_title_head">Backlight Timeout</string>
<string name="backlight_timeout_summary_head">Adjust the delay before the touch key backlight automatically turns off</string>
<string name="blink_timeout_title_head">Blink Timeout</string>
diff --git a/CrespoParts/res/xml/general_preferences.xml b/CrespoParts/res/xml/general_preferences.xml
index 44c0b9c..173d7eb 100644
--- a/CrespoParts/res/xml/general_preferences.xml
+++ b/CrespoParts/res/xml/general_preferences.xml
@@ -2,8 +2,8 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<!-- General settings -->
- <PreferenceCategory android:key="category_battery"
- android:title="@string/category_battery_title">
+ <PreferenceCategory android:key="category_cpu"
+ android:title="@string/category_cpu_title">
<CheckBoxPreference android:key="deepidle"
android:title="@string/cpu_deepidle_title_head"
@@ -13,20 +13,25 @@
<!-- Touch key backlight timeout -->
<PreferenceCategory android:key="category_touchkey"
android:title="@string/category_touchkey_title">
- <ListPreference
- android:key="backlight_timeout"
- android:title="@string/backlight_timeout_title_head"
- android:summary="@string/backlight_timeout_summary_head"
- android:entries="@array/backlight_timeout_entries"
- android:entryValues="@array/backlight_timeout_entries_values"
- android:defaultValue="5" />
- <ListPreference
- android:key="blink_timeout"
- android:title="@string/blink_timeout_title_head"
- android:summary="@string/blink_timeout_summary_head"
- android:entries="@array/blink_timeout_entries"
- android:entryValues="@array/blink_timeout_entries_values"
- android:defaultValue="5" />
+ <CheckBoxPreference android:key="touchkey_notification"
+ android:title="@string/touchkey_notification_title_head"
+ android:summary="@string/touchkey_notification_summary_head" />
+ <ListPreference
+ android:key="backlight_timeout"
+ android:title="@string/backlight_timeout_title_head"
+ android:summary="@string/backlight_timeout_summary_head"
+ android:entries="@array/backlight_timeout_entries"
+ android:entryValues="@array/backlight_timeout_entries_values"
+ android:defaultValue="5"
+ android:dependency="touchkey_notification" />
+ <ListPreference
+ android:key="blink_timeout"
+ android:title="@string/blink_timeout_title_head"
+ android:summary="@string/blink_timeout_summary_head"
+ android:entries="@array/blink_timeout_entries"
+ android:entryValues="@array/blink_timeout_entries_values"
+ android:defaultValue="5"
+ android:dependency="touchkey_notification" />
</PreferenceCategory>
</PreferenceScreen>
diff --git a/CrespoParts/res/xml/main.xml b/CrespoParts/res/xml/main.xml
deleted file mode 100644
index 224cffd..0000000
--- a/CrespoParts/res/xml/main.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
-
- <PreferenceCategory
- android:title="@string/category_screen_title">
- <!-- Color tuning -->
- <com.cyanogenmod.settings.device.ColorTuningPreference
- android:key="color_tuning"
- android:title="@string/color_tuning_title_head"
- android:summary="@string/color_tuning_summary_head" />
- <com.cyanogenmod.settings.device.GammaTuningPreference
- android:key="gamma_tuning"
- android:title="@string/gamma_tuning_title_head"
- android:summary="@string/gamma_tuning_summary_head" />
- </PreferenceCategory>
-
- <!-- WM8994 Control [TESTING] -->
- <PreferenceScreen android:key="wm8994_settings"
- android:title="@string/wm8994_settings_title_head"
- android:summary="@string/wm8994_settings_summary_head">
- <intent android:action="android.intent.action.MAIN"
- android:targetPackage="com.cyanogenmod.settings.device"
- android:targetClass="com.cyanogenmod.settings.device.WM8994ControlActivity" />
- </PreferenceScreen>
-
- <PreferenceCategory
- android:title="@string/category_touchkey_title">
- <!-- Touch key backlight timeout -->
- <ListPreference
- android:key="backlight_timeout"
- android:title="@string/backlight_timeout_title_head"
- android:summary="@string/backlight_timeout_summary_head"
- android:entries="@array/backlight_timeout_entries"
- android:entryValues="@array/backlight_timeout_entries_values"
- android:defaultValue="5" />
- <ListPreference
- android:key="blink_timeout"
- android:title="@string/blink_timeout_title_head"
- android:summary="@string/blink_timeout_summary_head"
- android:entries="@array/blink_timeout_entries"
- android:entryValues="@array/blink_timeout_entries_values"
- android:defaultValue="5" />
- </PreferenceCategory>
-
- <PreferenceCategory
- android:key="category_radio"
- android:title="@string/category_radio_title">
- <!-- UMTS/HSDPA/HSUPA settings -->
- <ListPreference
- android:key="hspa"
- android:title="@string/hspa_title_head"
- android:summary="@string/hspa_summary_head"
- android:entries="@array/hspa_entries"
- android:entryValues="@array/hspa_entries_values"
- android:defaultValue="23" />
- </PreferenceCategory>
-
-</PreferenceScreen>
diff --git a/CrespoParts/res/xml/wm8994_settings.xml b/CrespoParts/res/xml/wm8994_settings.xml
deleted file mode 100644
index 984fd61..0000000
--- a/CrespoParts/res/xml/wm8994_settings.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
-
- <!-- General settings -->
- <PreferenceCategory android:key="general_category"
- android:title="@string/general_sound_title">
-
- <CheckBoxPreference android:key="pref_wm8994_control_enable"
- android:title="@string/pref_wm8994_control_enable_title"
- android:summary="@string/pref_wm8994_control_enable_summary" />
- </PreferenceCategory>
-
- <!-- Internal speaker options -->
- <PreferenceCategory android:key="wm8994_internal_speaker_category"
- android:title="@string/category_wm8994_internal_speaker">
-
- <CheckBoxPreference android:key="pref_wm8994_speaker_tuning"
- android:title="@string/pref_wm8994_speaker_tuning_title"
- android:summary="@string/pref_wm8994_speaker_tuning_summary"
- android:dependency="pref_wm8994_control_enable" />
-
- </PreferenceCategory>
-
- <!-- Signal Processing -->
- <PreferenceCategory android:key="wm8994_signal_processing_category"
- android:title="@string/category_wm8994_signal_processing">
-
- <CheckBoxPreference android:key="pref_wm8994_mono_downmix"
- android:title="@string/pref_wm8994_mono_downmix_title"
- android:summary="@string/pref_wm8994_mono_downmix_summary"
- android:dependency="pref_wm8994_control_enable" />
-
- <CheckBoxPreference android:key="pref_wm8994_stereo_expansion"
- android:title="@string/pref_wm8994_stereo_expansion_title"
- android:summary="@string/pref_wm8994_stereo_expansion_summary"
- android:dependency="pref_wm8994_control_enable" />
-
- </PreferenceCategory>
-
- <!-- D/AC, A/DC -->
- <PreferenceCategory android:key="wm8994_dac_config_category"
- android:title="@string/category_wm8994_dac_config">
-
- <CheckBoxPreference android:key="pref_wm8994_dac_direct"
- android:title="@string/pref_wm8994_dac_direct_title"
- android:summary="@string/pref_wm8994_dac_direct_summary"
- android:dependency="pref_wm8994_control_enable" />
-
- <CheckBoxPreference android:key="pref_wm8994_dac_osr128"
- android:title="@string/pref_wm8994_dac_osr128_title"
- android:summary="@string/pref_wm8994_dac_osr128_summary"
- android:dependency="pref_wm8994_control_enable" />
-
- <CheckBoxPreference android:key="pref_wm8994_adc_osr128"
- android:title="@string/pref_wm8994_adc_osr128_title"
- android:summary="@string/pref_wm8994_adc_osr128_summary"
- android:dependency="pref_wm8994_control_enable" />
-
- </PreferenceCategory>
-
- <!-- Codec settings -->
- <PreferenceCategory android:key="wm8994_codec_optimization_category"
- android:title="@string/category_wm8994_codec_optimization">
-
- <CheckBoxPreference android:key="pref_wm8994_fll_tuning"
- android:title="@string/pref_wm8994_fll_tuning_title"
- android:summary="@string/pref_wm8994_fll_tuning_summary"
- android:dependency="pref_wm8994_control_enable" />
-
- </PreferenceCategory>
-
-</PreferenceScreen>
diff --git a/CrespoParts/src/com/cyanogenmod/settings/device/DeviceSettings.java b/CrespoParts/src/com/cyanogenmod/settings/device/DeviceSettings.java
index 9fde229..00a6bb8 100644
--- a/CrespoParts/src/com/cyanogenmod/settings/device/DeviceSettings.java
+++ b/CrespoParts/src/com/cyanogenmod/settings/device/DeviceSettings.java
@@ -46,6 +46,7 @@ public class DeviceSettings extends Activity {
public static final String KEY_BACKLIGHT_TIMEOUT = "backlight_timeout";
public static final String KEY_BLINK_TIMEOUT = "blink_timeout";
public static final String KEY_DEEPIDLE = "deepidle";
+ public static final String KEY_NOTIFICATION = "touchkey_notification";
public static final String KEY_CATEGORY_RADIO = "category_radio";
public static final String KEY_HSPA = "hspa";
diff --git a/CrespoParts/src/com/cyanogenmod/settings/device/GeneralFragmentActivity.java b/CrespoParts/src/com/cyanogenmod/settings/device/GeneralFragmentActivity.java
index 1f08425..007eb2a 100644
--- a/CrespoParts/src/com/cyanogenmod/settings/device/GeneralFragmentActivity.java
+++ b/CrespoParts/src/com/cyanogenmod/settings/device/GeneralFragmentActivity.java
@@ -32,11 +32,13 @@ import com.cyanogenmod.settings.device.R;
public class GeneralFragmentActivity extends PreferenceFragment {
- private static final String DEEPIDLE_FILE = "/sys/class/misc/deepidle/enabled";
+ private static final String CPU_DEEPIDLE_FILE = "/sys/class/misc/deepidle/enabled";
+ private static final String TOUCHKEY_NOTIFICATION_FILE = "/sys/class/misc/notification/enabled";
private static final String PREF_ENABLED = "1";
private static final String TAG = "CrespoParts_General";
private CheckBoxPreference mDeepIdle;
+ private CheckBoxPreference mNotification;
private ListPreference mBacklightTimeout;
private ListPreference mBlinkTimeout;
@@ -48,13 +50,20 @@ public class GeneralFragmentActivity extends PreferenceFragment {
PreferenceScreen prefSet = getPreferenceScreen();
mDeepIdle = (CheckBoxPreference) findPreference(DeviceSettings.KEY_DEEPIDLE);
+ mNotification = (CheckBoxPreference) findPreference(DeviceSettings.KEY_NOTIFICATION);
- if (isSupported(DEEPIDLE_FILE)) {
- mDeepIdle.setChecked(PREF_ENABLED.equals(Utils.readOneLine(DEEPIDLE_FILE)));
+ if (isSupported(CPU_DEEPIDLE_FILE)) {
+ mDeepIdle.setChecked(PREF_ENABLED.equals(Utils.readOneLine(CPU_DEEPIDLE_FILE)));
} else {
mDeepIdle.setEnabled(false);
}
+ if (isSupported(TOUCHKEY_NOTIFICATION_FILE)) {
+ mNotification.setChecked(PREF_ENABLED.equals(Utils.readOneLine(TOUCHKEY_NOTIFICATION_FILE)));
+ } else {
+ mNotification.setEnabled(false);
+ }
+
mBacklightTimeout = (ListPreference) findPreference(DeviceSettings.KEY_BACKLIGHT_TIMEOUT);
mBacklightTimeout.setEnabled(TouchKeyBacklightTimeout.isSupported());
mBacklightTimeout.setOnPreferenceChangeListener(new TouchKeyBacklightTimeout());
@@ -76,7 +85,11 @@ public class GeneralFragmentActivity extends PreferenceFragment {
if (key.equals(DeviceSettings.KEY_DEEPIDLE)) {
final CheckBoxPreference chkPref = (CheckBoxPreference) preference;
boxValue = chkPref.isChecked() ? "1" : "0";
- Utils.writeValue(DEEPIDLE_FILE, boxValue);
+ Utils.writeValue(CPU_DEEPIDLE_FILE, boxValue);
+ } else if (key.equals(DeviceSettings.KEY_NOTIFICATION)) {
+ final CheckBoxPreference chkPref = (CheckBoxPreference) preference;
+ boxValue = chkPref.isChecked() ? "1" : "0";
+ Utils.writeValue(TOUCHKEY_NOTIFICATION_FILE, boxValue);
}
return true;
@@ -88,9 +101,13 @@ public class GeneralFragmentActivity extends PreferenceFragment {
public static void restore(Context context) {
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
- if (isSupported(DEEPIDLE_FILE)) {
- String sDefaultValue = Utils.readOneLine(DEEPIDLE_FILE);
- Utils.writeValue(DEEPIDLE_FILE, sharedPrefs.getBoolean(DeviceSettings.KEY_DEEPIDLE, PREF_ENABLED.equals(sDefaultValue)));
+ if (isSupported(CPU_DEEPIDLE_FILE)) {
+ String sDefaultValue = Utils.readOneLine(CPU_DEEPIDLE_FILE);
+ Utils.writeValue(CPU_DEEPIDLE_FILE, sharedPrefs.getBoolean(DeviceSettings.KEY_DEEPIDLE, PREF_ENABLED.equals(sDefaultValue)));
+ }
+ if (isSupported(TOUCHKEY_NOTIFICATION_FILE)) {
+ String sDefaultValue = Utils.readOneLine(TOUCHKEY_NOTIFICATION_FILE);
+ Utils.writeValue(TOUCHKEY_NOTIFICATION_FILE, sharedPrefs.getBoolean(DeviceSettings.KEY_NOTIFICATION, PREF_ENABLED.equals(sDefaultValue)));
}
}
}