Merge "Make accessing mWaitingForDrawn thread-safe"
This commit is contained in:
@@ -11982,6 +11982,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
|
||||
@Override
|
||||
public void waitForAllWindowsDrawn(Runnable callback, long timeout) {
|
||||
boolean allWindowsDrawn = false;
|
||||
synchronized (mWindowMap) {
|
||||
mWaitingForDrawnCallback = callback;
|
||||
final WindowList windows = getDefaultWindowListLocked();
|
||||
@@ -12002,13 +12003,16 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
}
|
||||
}
|
||||
requestTraversalLocked();
|
||||
mH.removeMessages(H.WAITING_FOR_DRAWN_TIMEOUT);
|
||||
if (mWaitingForDrawn.isEmpty()) {
|
||||
allWindowsDrawn = true;
|
||||
} else {
|
||||
mH.sendEmptyMessageDelayed(H.WAITING_FOR_DRAWN_TIMEOUT, timeout);
|
||||
checkDrawnWindowsLocked();
|
||||
}
|
||||
}
|
||||
mH.removeMessages(H.WAITING_FOR_DRAWN_TIMEOUT);
|
||||
if (mWaitingForDrawn.isEmpty()) {
|
||||
if (allWindowsDrawn) {
|
||||
callback.run();
|
||||
} else {
|
||||
mH.sendEmptyMessageDelayed(H.WAITING_FOR_DRAWN_TIMEOUT, timeout);
|
||||
checkDrawnWindowsLocked();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user