Fix issue #5355844: PowerManager does not call screenTurningOn after boot.
Be more explicit about initialization -- power manager never sends
screen update when first initializing, phone window manager retreives
current screen state and applies that itself when initializing.
Change-Id: I8294ed36d700e186c1637754df8c8183721c15dd
diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java
index 785db98..78dbbd6 100644
--- a/services/java/com/android/server/PowerManagerService.java
+++ b/services/java/com/android/server/PowerManagerService.java
@@ -564,6 +564,7 @@
// We make sure to start out with the screen on due to user activity.
// (They did just boot their device, after all.)
forceUserActivityLocked();
+ mInitialized = true;
}
}
@@ -1330,6 +1331,13 @@
// (And also do not send needless broadcasts about the screen.)
return;
}
+
+ if (DEBUG_SCREEN_ON) {
+ RuntimeException here = new RuntimeException("here");
+ here.fillInStackTrace();
+ Slog.i(TAG, "sendNotificationLocked: " + on, here);
+ }
+
if (!on) {
mStillNeedSleepNotification = false;
}
@@ -1845,8 +1853,6 @@
mPowerState = (mPowerState & ~LIGHTS_MASK) | (newState & LIGHTS_MASK);
updateNativePowerStateLocked();
-
- mInitialized = true;
}
}