From 6d747656628aa86ee2190a3e5939d447623294a5 Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Mon, 11 Oct 2010 15:15:31 -0700 Subject: Add a configuration option to turn on the screen when you unplug the device. Bug: 3068624 Change-Id: I7366ece2528b31feee920f4600a475e81a0f3709 --- core/res/res/values/config.xml | 3 +++ services/java/com/android/server/PowerManagerService.java | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 340e23c..c3cbf07 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -148,6 +148,9 @@ false + + + false diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java index 69fa3bf..88a4c90 100644 --- a/services/java/com/android/server/PowerManagerService.java +++ b/services/java/com/android/server/PowerManagerService.java @@ -245,6 +245,7 @@ class PowerManagerService extends IPowerManager.Stub private int[] mButtonBacklightValues; private int[] mKeyboardBacklightValues; private int mLightSensorWarmupTime; + boolean mUnplugTurnsOnScreen; private int mWarningSpewThrottleCount; private long mWarningSpewThrottleTime; @@ -366,8 +367,12 @@ class PowerManagerService extends IPowerManager.Stub // user activity when screen was already on. // temporarily set mUserActivityAllowed to true so this will work // even when the keyguard is on. + // However, you can also set config_unplugTurnsOnScreen to have it + // turn on. Some devices want this because they don't have a + // charging LED. synchronized (mLocks) { - if (!wasPowered || (mPowerState & SCREEN_ON_BIT) != 0) { + if (!wasPowered || (mPowerState & SCREEN_ON_BIT) != 0 || + mUnplugTurnsOnScreen) { forceUserActivityLocked(); } } @@ -526,6 +531,9 @@ class PowerManagerService extends IPowerManager.Stub Resources resources = mContext.getResources(); + mUnplugTurnsOnScreen = resources.getBoolean( + com.android.internal.R.bool.config_unplugTurnsOnScreen); + // read settings for auto-brightness mUseSoftwareAutoBrightness = resources.getBoolean( com.android.internal.R.bool.config_automatic_brightness_available); -- cgit v1.1