Merge "Add a configuration option to turn on the screen when you unplug the device." into gingerbread
This commit is contained in:
@ -148,6 +148,9 @@
|
|||||||
<!-- Flag indicating whether the we should enable the automatic brightness in Settings.
|
<!-- 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 -->
|
Software implementation will be used if config_hardware_auto_brightness_available is not set -->
|
||||||
<bool name="config_automatic_brightness_available">false</bool>
|
<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 -->
|
<!-- XXXXXX END OF RESOURCES USING WRONG NAMING CONVENTION -->
|
||||||
|
|
||||||
|
@ -245,6 +245,7 @@ class PowerManagerService extends IPowerManager.Stub
|
|||||||
private int[] mButtonBacklightValues;
|
private int[] mButtonBacklightValues;
|
||||||
private int[] mKeyboardBacklightValues;
|
private int[] mKeyboardBacklightValues;
|
||||||
private int mLightSensorWarmupTime;
|
private int mLightSensorWarmupTime;
|
||||||
|
boolean mUnplugTurnsOnScreen;
|
||||||
private int mWarningSpewThrottleCount;
|
private int mWarningSpewThrottleCount;
|
||||||
private long mWarningSpewThrottleTime;
|
private long mWarningSpewThrottleTime;
|
||||||
|
|
||||||
@ -366,8 +367,12 @@ class PowerManagerService extends IPowerManager.Stub
|
|||||||
// user activity when screen was already on.
|
// user activity when screen was already on.
|
||||||
// temporarily set mUserActivityAllowed to true so this will work
|
// temporarily set mUserActivityAllowed to true so this will work
|
||||||
// even when the keyguard is on.
|
// 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) {
|
synchronized (mLocks) {
|
||||||
if (!wasPowered || (mPowerState & SCREEN_ON_BIT) != 0) {
|
if (!wasPowered || (mPowerState & SCREEN_ON_BIT) != 0 ||
|
||||||
|
mUnplugTurnsOnScreen) {
|
||||||
forceUserActivityLocked();
|
forceUserActivityLocked();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -526,6 +531,9 @@ class PowerManagerService extends IPowerManager.Stub
|
|||||||
|
|
||||||
Resources resources = mContext.getResources();
|
Resources resources = mContext.getResources();
|
||||||
|
|
||||||
|
mUnplugTurnsOnScreen = resources.getBoolean(
|
||||||
|
com.android.internal.R.bool.config_unplugTurnsOnScreen);
|
||||||
|
|
||||||
// read settings for auto-brightness
|
// read settings for auto-brightness
|
||||||
mUseSoftwareAutoBrightness = resources.getBoolean(
|
mUseSoftwareAutoBrightness = resources.getBoolean(
|
||||||
com.android.internal.R.bool.config_automatic_brightness_available);
|
com.android.internal.R.bool.config_automatic_brightness_available);
|
||||||
|
Reference in New Issue
Block a user