Skip to content

Commit 3d7b7d5

Browse files
author
Craig Mautner
committed
Redraw all windows earlier in power on sequence.
Send a message to all windows to redraw before notifying PhoneWindowManager of screen on. This minimizes the delay in screen update that causes the keyguard clock to display the old time before displaying the current time. Fixes bug 6381021. Change-Id: Ida7071e7dac2284540f101c5d004511b52133b91
1 parent 6385ff5 commit 3d7b7d5

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3506,6 +3506,10 @@ public void screenTurningOn(final ScreenOnListener screenOnListener) {
35063506
}
35073507
if (screenOnListener != null) {
35083508
if (mKeyguardMediator != null) {
3509+
try {
3510+
mWindowManager.setEventDispatching(true);
3511+
} catch (RemoteException unhandled) {
3512+
}
35093513
mKeyguardMediator.onScreenTurnedOn(new KeyguardViewManager.ShowListener() {
35103514
@Override public void onShown(IBinder windowToken) {
35113515
if (windowToken != null) {

services/java/com/android/server/wm/WindowManagerService.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6621,15 +6621,14 @@ public void resumeKeyDispatching(IBinder _token) {
66216621

66226622
public void setEventDispatching(boolean enabled) {
66236623
if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
6624-
"resumeKeyDispatching()")) {
6624+
"setEventDispatching()")) {
66256625
throw new SecurityException("Requires MANAGE_APP_TOKENS permission");
66266626
}
66276627

66286628
synchronized (mWindowMap) {
66296629
mInputMonitor.setEventDispatchingLw(enabled);
6630+
sendScreenStatusToClientsLocked();
66306631
}
6631-
6632-
sendScreenStatusToClients();
66336632
}
66346633

66356634
public IBinder getFocusedWindowClientToken() {
@@ -6735,7 +6734,7 @@ public void systemReady() {
67356734
mPolicy.systemReady();
67366735
}
67376736

6738-
private void sendScreenStatusToClients() {
6737+
private void sendScreenStatusToClientsLocked() {
67396738
final ArrayList<WindowState> windows = mWindows;
67406739
final int count = windows.size();
67416740
boolean on = mPowerManager.isScreenOn();

0 commit comments

Comments
 (0)