diff options
author | Mike Lockwood <lockwood@android.com> | 2009-10-14 21:17:09 -0700 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2009-10-16 07:42:26 -0700 |
commit | dc3494e3d8e17aeb0dbbe41953a5ef763d95ff78 (patch) | |
tree | 7c7cf80014fc1cfaff208fd268f5bd987d43bef8 /packages/SettingsProvider | |
parent | 37a13208c93bbe00cf233baf1ebcd6e081972a27 (diff) | |
download | frameworks_base-dc3494e3d8e17aeb0dbbe41953a5ef763d95ff78.zip frameworks_base-dc3494e3d8e17aeb0dbbe41953a5ef763d95ff78.tar.gz frameworks_base-dc3494e3d8e17aeb0dbbe41953a5ef763d95ff78.tar.bz2 |
Remove PowerManager.setAutoBrightness()
We will use the System.SCREEN_BRIGHTNESS_MODE Settings value instead.
Add SCREEN_BRIGHTNESS_MODE_MANUAL and SCREEN_BRIGHTNESS_MODE_AUTOMATIC constants.
Change-Id: I01935be3fcb48cf76392d2c594205cb47babc5b2
Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'packages/SettingsProvider')
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java index 3b91a38..153a5ea 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java @@ -45,7 +45,6 @@ public class SettingsHelper { private boolean mSilent; private boolean mVibrate; - private boolean mHasAutoBrightness; public SettingsHelper(Context context) { mContext = context; @@ -54,9 +53,6 @@ public class SettingsHelper { mContentService = ContentResolver.getContentService(); mPowerManager = IPowerManager.Stub.asInterface( ServiceManager.getService("power")); - - mHasAutoBrightness = context.getResources().getBoolean( - com.android.internal.R.bool.config_automatic_brightness_available); } /** @@ -71,18 +67,6 @@ public class SettingsHelper { public boolean restoreValue(String name, String value) { if (Settings.System.SCREEN_BRIGHTNESS.equals(name)) { setBrightness(Integer.parseInt(value)); - } else if (Settings.System.SCREEN_BRIGHTNESS_MODE.equals(name)) { - if (mHasAutoBrightness) { - // When setting auto-brightness, must reset the brightness afterwards - try { - int curBrightness = Settings.System.getInt(mContext.getContentResolver(), - Settings.System.SCREEN_BRIGHTNESS); - setAutoBrightness(Integer.parseInt(value) != 0); - setBrightness(curBrightness); - } catch (Settings.SettingNotFoundException e) { - // no brightness setting at all? weird. skip this then. - } - } } else if (Settings.System.SOUND_EFFECTS_ENABLED.equals(name)) { setSoundEffects(Integer.parseInt(value) == 1); } else if (Settings.Secure.LOCATION_PROVIDERS_ALLOWED.equals(name)) { @@ -92,16 +76,6 @@ public class SettingsHelper { return true; } - private void setAutoBrightness(boolean value) { - if (mPowerManager != null) { - try { - mPowerManager.setAutoBrightness(value); - } catch (RemoteException e) { - // unable to reach the power manager; skip - } - } - } - private void setGpsLocation(String value) { final String GPS = LocationManager.GPS_PROVIDER; boolean enabled = |