summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/power/PowerManagerService.java
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2012-08-25 13:46:49 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-08-25 13:46:49 -0700
commitd59db50ab0c3c7a232b2a564e763ca46c6f6ebfa (patch)
tree56d64362d3d4d6ce3811c7a07d039ab7f883793d /services/java/com/android/server/power/PowerManagerService.java
parent04a286b95528e1fe7c0a18e8780a64bfadbd1eba (diff)
parentf75724b3d36d84c881d4052cfd4be766d454c98f (diff)
Merge "Initialize screen state earlier in the boot process." into jb-mr1-dev
Diffstat (limited to 'services/java/com/android/server/power/PowerManagerService.java')
-rw-r--r--services/java/com/android/server/power/PowerManagerService.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/services/java/com/android/server/power/PowerManagerService.java b/services/java/com/android/server/power/PowerManagerService.java
index cbb5b6df1677..6d681046a2c6 100644
--- a/services/java/com/android/server/power/PowerManagerService.java
+++ b/services/java/com/android/server/power/PowerManagerService.java
@@ -296,6 +296,7 @@ public final class PowerManagerService extends IPowerManager.Stub
}
nativeInit();
+ nativeSetPowerState(true, true);
}
/**
@@ -305,6 +306,14 @@ public final class PowerManagerService extends IPowerManager.Stub
public void init(Context context, LightsService ls,
ActivityManagerService am, BatteryService bs, IBatteryStats bss,
DisplayManagerService dm) {
+ // Forcibly turn the screen on at boot so that it is in a known power state.
+ // We do this in init() rather than in the constructor because setting the
+ // screen state requires a call into surface flinger which then needs to call back
+ // into the activity manager to check permissions. Unfortunately the
+ // activity manager is not running when the constructor is called, so we
+ // have to defer setting the screen state until this point.
+ nativeSetScreenState(true);
+
mContext = context;
mLightsService = ls;
mBatteryService = bs;