diff options
| author | Steve Kondik <shade@chemlab.org> | 2009-11-07 12:41:44 -0500 |
|---|---|---|
| committer | Steve Kondik <shade@chemlab.org> | 2009-11-07 12:41:44 -0500 |
| commit | 7cdd9a0ec21460e539fd8f94184855163560ea2f (patch) | |
| tree | 943439cd6c853d03d13017e6bf909dc2190a40fa /apps | |
| parent | d6956b44a3cfe6f1178979ada6ca3451a260a144 (diff) | |
| download | android_development-7cdd9a0ec21460e539fd8f94184855163560ea2f.tar.gz android_development-7cdd9a0ec21460e539fd8f94184855163560ea2f.tar.bz2 android_development-7cdd9a0ec21460e539fd8f94184855163560ea2f.zip | |
Add preference for compcache
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/SpareParts/res/values/strings.xml | 4 | ||||
| -rw-r--r-- | apps/SpareParts/res/xml/spare_parts.xml | 7 | ||||
| -rw-r--r-- | apps/SpareParts/src/com/android/spare_parts/SpareParts.java | 15 |
3 files changed, 23 insertions, 3 deletions
diff --git a/apps/SpareParts/res/values/strings.xml b/apps/SpareParts/res/values/strings.xml index 9470d8dc1..129ac0212 100644 --- a/apps/SpareParts/res/values/strings.xml +++ b/apps/SpareParts/res/values/strings.xml @@ -73,6 +73,10 @@ <string name="summary_on_launcher_orientation">Launcher will auto-orientate using accelerometer</string> <string name="summary_off_launcher_orientation">Launcher will not auto-orientate</string> + <string name="title_compcache_enabled">Compcache enabled</string> + <string name="summary_on_compcache_enabled">Compressed caching is enabled</string> + <string name="summary_off_compcache_enabled">Compressed caching is disabled</string> + <!-- Sound & display settings screen, compatibility mode check box label --> <string name="compatibility_mode_title">Compatibility Mode</string> <!-- Sound & display settings screen, compatibility mode option summary text when check box is selected --> diff --git a/apps/SpareParts/res/xml/spare_parts.xml b/apps/SpareParts/res/xml/spare_parts.xml index 6acf57c5f..b20e272c5 100644 --- a/apps/SpareParts/res/xml/spare_parts.xml +++ b/apps/SpareParts/res/xml/spare_parts.xml @@ -106,6 +106,13 @@ android:title="@string/compatibility_mode_title" android:summaryOn="@string/compatibility_mode_summary_on" android:summaryOff="@string/compatibility_mode_summary_off" /> + + <CheckBoxPreference + android:key="compcache_enabled" + android:title="@string/title_compcache_enabled" + android:summaryOn="@string/summary_on_compcache_enabled" + android:summaryOff="@string/summary_off_compcache_enabled" /> + </PreferenceCategory> <PreferenceCategory diff --git a/apps/SpareParts/src/com/android/spare_parts/SpareParts.java b/apps/SpareParts/src/com/android/spare_parts/SpareParts.java index b5d5d658e..0301ac11d 100644 --- a/apps/SpareParts/src/com/android/spare_parts/SpareParts.java +++ b/apps/SpareParts/src/com/android/spare_parts/SpareParts.java @@ -61,7 +61,8 @@ public class SpareParts extends PreferenceActivity private static final String KEY_COMPATIBILITY_MODE = "compatibility_mode"; private static final String PIN_HOME_PREF = "pin_home"; private static final String LAUNCHER_ORIENTATION_PREF = "launcher_orientation"; - + private static final String COMPCACHE_PREF = "compcache_enabled"; + private final Configuration mCurConfig = new Configuration(); private ListPreference mWindowAnimationsPref; @@ -74,7 +75,8 @@ public class SpareParts extends PreferenceActivity private CheckBoxPreference mCompatibilityMode; private CheckBoxPreference mPinHomePref; private CheckBoxPreference mLauncherOrientationPref; - + private CheckBoxPreference mCompcachePref; + private IWindowManager mWindowManager; public static boolean updatePreferenceToSpecificActivityOrRemove(Context context, @@ -132,7 +134,8 @@ public class SpareParts extends PreferenceActivity mShowMapsCompassPref = (CheckBoxPreference) prefSet.findPreference(MAPS_COMPASS_PREF); mPinHomePref = (CheckBoxPreference) prefSet.findPreference(PIN_HOME_PREF); mLauncherOrientationPref = (CheckBoxPreference) prefSet.findPreference(LAUNCHER_ORIENTATION_PREF); - + mCompcachePref = (CheckBoxPreference) prefSet.findPreference(COMPCACHE_PREF); + mCompatibilityMode = (CheckBoxPreference) findPreference(KEY_COMPATIBILITY_MODE); mCompatibilityMode.setPersistent(false); mCompatibilityMode.setChecked(Settings.System.getInt(getContentResolver(), @@ -168,6 +171,9 @@ public class SpareParts extends PreferenceActivity mLauncherOrientationPref.setChecked(Settings.System.getInt( getContentResolver(), "launcher_orientation", 1) != 0); + mCompcachePref.setChecked(Settings.Secure.getInt( + getContentResolver(), + Settings.Secure.COMPCACHE_ENABLED, 0) != 0); } catch (NameNotFoundException e) { Log.w(TAG, "Failed reading maps compass"); e.printStackTrace(); @@ -291,6 +297,9 @@ public class SpareParts extends PreferenceActivity } else if (LAUNCHER_ORIENTATION_PREF.equals(key)) { Settings.System.putInt(getContentResolver(), "launcher_orientation", mLauncherOrientationPref.isChecked() ? 1 : 0); + } else if (COMPCACHE_PREF.equals(key)) { + Settings.Secure.putInt(getContentResolver(), Settings.Secure.COMPCACHE_ENABLED, + mCompcachePref.isChecked() ? 1 : 0); } } |
