summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Onorato <joeo@android.com>2010-10-11 15:22:30 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-10-11 15:22:30 -0700
commit14854820eac895a925791fb41ccd330447fd4f02 (patch)
tree2a51b4aaada03918304877c535f2e5f34d514fa6
parentad9a559c611a2901a490c887f03d9622695beba2 (diff)
parentc0ad216c8ebc74b59074a7538533605eebfd65c3 (diff)
downloadframeworks_base-14854820eac895a925791fb41ccd330447fd4f02.zip
frameworks_base-14854820eac895a925791fb41ccd330447fd4f02.tar.gz
frameworks_base-14854820eac895a925791fb41ccd330447fd4f02.tar.bz2
am c0ad216c: Merge "Add a configuration option to turn on the screen when you unplug the device." into gingerbread
Merge commit 'c0ad216c8ebc74b59074a7538533605eebfd65c3' into gingerbread-plus-aosp * commit 'c0ad216c8ebc74b59074a7538533605eebfd65c3': Add a configuration option to turn on the screen when you unplug the device.
-rw-r--r--core/res/res/values/config.xml3
-rw-r--r--services/java/com/android/server/PowerManagerService.java10
2 files changed, 12 insertions, 1 deletions
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 29c86c0..0c7556b 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -148,6 +148,9 @@
<!-- 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>
+
+ <!-- If this is true, the screen will come on when you unplug usb/power/whatever. -->
+ <bool name="config_unplugTurnsOnScreen">false</bool>
<!-- XXXXXX END OF RESOURCES USING WRONG NAMING CONVENTION -->
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);