diff options
Diffstat (limited to 'services/java/com/android/server/wm/WindowManagerService.java')
| -rwxr-xr-x | services/java/com/android/server/wm/WindowManagerService.java | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index 8cc3d61..8f5103c 100755 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -9450,18 +9450,22 @@ public class WindowManagerService extends IWindowManager.Stub } } - public void waitForWindowDrawn(IBinder token, IRemoteCallback callback) { - synchronized (mWindowMap) { - WindowState win = windowForClientLocked(null, token, true); - if (win != null) { - Pair<WindowState, IRemoteCallback> pair = - new Pair<WindowState, IRemoteCallback>(win, callback); - Message m = mH.obtainMessage(H.WAITING_FOR_DRAWN_TIMEOUT, pair); - mH.sendMessageDelayed(m, 2000); - mWaitingForDrawn.add(pair); - checkDrawnWindowsLocked(); + public boolean waitForWindowDrawn(IBinder token, IRemoteCallback callback) { + if (token != null && callback != null) { + synchronized (mWindowMap) { + WindowState win = windowForClientLocked(null, token, true); + if (win != null) { + Pair<WindowState, IRemoteCallback> pair = + new Pair<WindowState, IRemoteCallback>(win, callback); + Message m = mH.obtainMessage(H.WAITING_FOR_DRAWN_TIMEOUT, pair); + mH.sendMessageDelayed(m, 2000); + mWaitingForDrawn.add(pair); + checkDrawnWindowsLocked(); + return true; + } } } + return false; } void setHoldScreenLocked(final Session newHoldScreen) { @@ -9475,10 +9479,10 @@ public class WindowManagerService extends IWindowManager.Stub final boolean state = mHoldingScreenWakeLock.isHeld(); if (hold != state) { if (hold) { - mPolicy.screenOnStartedLw(); mHoldingScreenWakeLock.acquire(); + mPolicy.keepScreenOnStartedLw(); } else { - mPolicy.screenOnStoppedLw(); + mPolicy.keepScreenOnStoppedLw(); mHoldingScreenWakeLock.release(); } } |
