summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/BrightnessPreference.java
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2009-09-15 14:39:47 -0400
committerMike Lockwood <lockwood@android.com>2009-09-15 15:24:14 -0400
commitcd03f5320d42290b1619933954a344b59dc55f4f (patch)
tree5f9544a5147112e9bc6c47c71b093966dd6508dc /src/com/android/settings/BrightnessPreference.java
parenta096888f3c7e14723168c323f0ffdb2473adf5d3 (diff)
downloadpackages_apps_settings-cd03f5320d42290b1619933954a344b59dc55f4f.zip
packages_apps_settings-cd03f5320d42290b1619933954a344b59dc55f4f.tar.gz
packages_apps_settings-cd03f5320d42290b1619933954a344b59dc55f4f.tar.bz2
Move backlight brightness from HardwareService to PowerManager
to prevent apps from changing the hardware behind its back. Fixes b/2041941 Lock screen flashes the screen very bright before dimming Change-Id: Ic4faa008357fd3d74225ba90f05801c5127fd8c0 Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'src/com/android/settings/BrightnessPreference.java')
-rw-r--r--src/com/android/settings/BrightnessPreference.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/com/android/settings/BrightnessPreference.java b/src/com/android/settings/BrightnessPreference.java
index 61d3cf9..e2fe0f2 100644
--- a/src/com/android/settings/BrightnessPreference.java
+++ b/src/com/android/settings/BrightnessPreference.java
@@ -18,7 +18,7 @@ package com.android.settings;
import android.content.Context;
import android.os.RemoteException;
-import android.os.IHardwareService;
+import android.os.IPowerManager;
import android.os.ServiceManager;
import android.preference.SeekBarPreference;
import android.provider.Settings;
@@ -130,10 +130,10 @@ public class BrightnessPreference extends SeekBarPreference implements
private void setBrightness(int brightness) {
try {
- IHardwareService hardware = IHardwareService.Stub.asInterface(
- ServiceManager.getService("hardware"));
- if (hardware != null) {
- hardware.setBacklights(brightness);
+ IPowerManager power = IPowerManager.Stub.asInterface(
+ ServiceManager.getService("power"));
+ if (power != null) {
+ power.setBacklightBrightness(brightness);
}
} catch (RemoteException doe) {
@@ -147,10 +147,10 @@ public class BrightnessPreference extends SeekBarPreference implements
mSeekBar.setVisibility(View.VISIBLE);
}
try {
- IHardwareService hardware = IHardwareService.Stub.asInterface(
- ServiceManager.getService("hardware"));
- if (hardware != null) {
- hardware.setAutoBrightness(automatic != 0);
+ IPowerManager power = IPowerManager.Stub.asInterface(
+ ServiceManager.getService("power"));
+ if (power != null) {
+ power.setAutoBrightness(automatic != 0);
}
} catch (RemoteException doe) {
}