diff options
author | Mike Lockwood <lockwood@android.com> | 2009-11-03 11:41:27 -0500 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2009-11-03 11:41:27 -0500 |
commit | f90ffcc639fe979f346f062d620d34c28e57c885 (patch) | |
tree | beb14a4f626bd46ffd4732ed3777543ec74a202e | |
parent | 4115c518753052add46b017bb3044da6f6169a7b (diff) | |
download | frameworks_base-f90ffcc639fe979f346f062d620d34c28e57c885.zip frameworks_base-f90ffcc639fe979f346f062d620d34c28e57c885.tar.gz frameworks_base-f90ffcc639fe979f346f062d620d34c28e57c885.tar.bz2 |
Remove obsolete hardware auto-brightness support.
Change-Id: Ibd0ef67f887254f26ce19faf0627f8b246ec0a18
Signed-off-by: Mike Lockwood <lockwood@android.com>
-rw-r--r-- | core/res/res/values/config.xml | 5 | ||||
-rwxr-xr-x | services/java/com/android/server/HardwareService.java | 12 | ||||
-rw-r--r-- | services/java/com/android/server/PowerManagerService.java | 29 | ||||
-rw-r--r-- | services/jni/com_android_server_HardwareService.cpp | 13 |
4 files changed, 2 insertions, 57 deletions
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index bd6e7b4..9058221 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -71,11 +71,6 @@ the slider can be opened (for example, in a pocket or purse). --> <bool name="config_bypass_keyguard_if_slider_open">true</bool> - <!-- Flag indicating whether the device supports automatic brightness mode in hardware. - WARNING - DO NOT USE THIS FEATURE - Hardware auto brightness support is deprecated and will be removed in the next release. --> - <bool name="config_hardware_automatic_brightness_available">false</bool> - <!-- Flag indicating whether the we should enable the automatic brightness in Settings. Software implementation will be used if config_hardware_auto_brightness_available is not set --> <bool name="config_automatic_brightness_available">false</bool> diff --git a/services/java/com/android/server/HardwareService.java b/services/java/com/android/server/HardwareService.java index 7c56a30..b1d58ce 100755 --- a/services/java/com/android/server/HardwareService.java +++ b/services/java/com/android/server/HardwareService.java @@ -59,8 +59,6 @@ public class HardwareService extends IHardwareService.Stub { private boolean mAttentionLightOn; private boolean mPulsing; - private boolean mAutoBrightnessAvailable; - private class Vibration implements IBinder.DeathRecipient { private final IBinder mToken; private final long mTimeout; @@ -131,9 +129,6 @@ public class HardwareService extends IHardwareService.Stub { IntentFilter filter = new IntentFilter(); filter.addAction(Intent.ACTION_SCREEN_OFF); context.registerReceiver(mIntentReceiver, filter); - - mAutoBrightnessAvailable = context.getResources().getBoolean( - com.android.internal.R.bool.config_hardware_automatic_brightness_available); } protected void finalize() throws Throwable { @@ -287,12 +282,6 @@ public class HardwareService extends IHardwareService.Stub { setLight_native(mNativePointer, light, color, mode, onMS, offMS); } - void setAutoBrightness_UNCHECKED(boolean on) { - if (mAutoBrightnessAvailable) { - setAutoBrightness_native(mNativePointer, on); - } - } - public void setAttentionLight(boolean on) { // Not worthy of a permission. We shouldn't have a flashlight permission. synchronized (this) { @@ -493,7 +482,6 @@ public class HardwareService extends IHardwareService.Stub { private static native int init_native(); private static native void finalize_native(int ptr); - private static native void setAutoBrightness_native(int ptr, boolean automatic); private static native void setLight_native(int ptr, int light, int color, int mode, int onMS, int offMS); diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java index 8a7c28f..f75f719 100644 --- a/services/java/com/android/server/PowerManagerService.java +++ b/services/java/com/android/server/PowerManagerService.java @@ -218,12 +218,6 @@ class PowerManagerService extends IPowerManager.Stub private int[] mButtonBacklightValues; private int[] mKeyboardBacklightValues; - /* - * WARNING - DO NOT USE THE HARDWARE AUTO-BRIGHTNESS FEATURE - * Hardware auto brightness support is deprecated and will be removed in the next release. - */ - private boolean mUseHardwareAutoBrightness; - // Used when logging number and duration of touch-down cycles private long mTotalTouchDownTime; private long mLastTouchDown; @@ -448,17 +442,6 @@ class PowerManagerService extends IPowerManager.Stub // read settings for auto-brightness mUseSoftwareAutoBrightness = resources.getBoolean( com.android.internal.R.bool.config_automatic_brightness_available); - - /* - * WARNING - DO NOT USE THE HARDWARE AUTO-BRIGHTNESS FEATURE - * Hardware auto brightness support is deprecated and will be removed in the next release. - */ - mUseHardwareAutoBrightness = resources.getBoolean( - com.android.internal.R.bool.config_hardware_automatic_brightness_available); - if (mUseHardwareAutoBrightness) { - mUseSoftwareAutoBrightness = false; - } - if (mUseSoftwareAutoBrightness) { mAutoBrightnessLevels = resources.getIntArray( com.android.internal.R.array.config_autoBrightnessLevels); @@ -906,7 +889,6 @@ class PowerManagerService extends IPowerManager.Stub pw.println(" mLightSensorEnabled=" + mLightSensorEnabled); pw.println(" mLightSensorValue=" + mLightSensorValue); pw.println(" mLightSensorPendingValue=" + mLightSensorPendingValue); - pw.println(" mUseHardwareAutoBrightness=" + mUseHardwareAutoBrightness); pw.println(" mUseSoftwareAutoBrightness=" + mUseSoftwareAutoBrightness); pw.println(" mAutoBrightessEnabled=" + mAutoBrightessEnabled); mScreenBrightness.dump(pw, " mScreenBrightness: "); @@ -2086,16 +2068,9 @@ class PowerManagerService extends IPowerManager.Stub private void setScreenBrightnessMode(int mode) { boolean enabled = (mode == SCREEN_BRIGHTNESS_MODE_AUTOMATIC); - if (mAutoBrightessEnabled != enabled) { + if (mUseSoftwareAutoBrightness && mAutoBrightessEnabled != enabled) { mAutoBrightessEnabled = enabled; - - if (mUseHardwareAutoBrightness) { - // When setting auto-brightness, must reset the brightness afterwards - mHardware.setAutoBrightness_UNCHECKED(enabled); - if (screenIsOn()) { - setBacklightBrightness((int)mScreenBrightness.curValue); - } - } else if (mUseSoftwareAutoBrightness && screenIsOn()) { + if (screenIsOn()) { // force recompute of backlight values if (mLightSensorValue >= 0) { int value = (int)mLightSensorValue; diff --git a/services/jni/com_android_server_HardwareService.cpp b/services/jni/com_android_server_HardwareService.cpp index a17e29f..22d4bd8 100644 --- a/services/jni/com_android_server_HardwareService.cpp +++ b/services/jni/com_android_server_HardwareService.cpp @@ -100,18 +100,6 @@ static void finalize_native(JNIEnv *env, jobject clazz, int ptr) free(devices); } -static void setAutoBrightness_native(JNIEnv *env, jobject clazz, int ptr, - jboolean automatic) -{ - Devices* devices = (Devices*)ptr; - - if (devices->lights[LIGHT_INDEX_BACKLIGHT] == NULL) { - return; - } - - devices->lights[LIGHT_INDEX_BACKLIGHT]->set_als_mode(automatic ? 0 : 1); -} - static void setLight_native(JNIEnv *env, jobject clazz, int ptr, int light, int colorARGB, int flashMode, int onMS, int offMS) { @@ -146,7 +134,6 @@ static void vibratorOff(JNIEnv *env, jobject clazz) static JNINativeMethod method_table[] = { { "init_native", "()I", (void*)init_native }, { "finalize_native", "(I)V", (void*)finalize_native }, - { "setAutoBrightness_native", "(IZ)V", (void*)setAutoBrightness_native }, { "setLight_native", "(IIIIII)V", (void*)setLight_native }, { "vibratorOn", "(J)V", (void*)vibratorOn }, { "vibratorOff", "()V", (void*)vibratorOff } |