Fix deadlock between WMG and WMS
The dealock happened while WM#addView and WMS holds lock and called onWindowTokenRemoved. WM#addView -> WMG#addView(holds WMG lock) -> ... -> WMS#addWindow(holds WMS lock) (holds WMS lock) ... -> WindowTokenClient#onWindowTokenRemoved ... -> WMG#closeAll(holds WMG lock) This CL calls to WMG#closeAll asynchronously to release WMG lock fixes: 181839758 Test: manual Change-Id: I0cf8a505043a4def4dcf346952873b1362a92084
This commit is contained in:
@@ -85,8 +85,10 @@ public class WindowTokenClient extends IWindowToken.Stub {
|
||||
context.destroy();
|
||||
mContextRef.clear();
|
||||
}
|
||||
// If a secondary display is detached, release all views attached to this token.
|
||||
WindowManagerGlobal.getInstance().closeAll(this, mContextRef.getClass().getName(),
|
||||
"WindowContext");
|
||||
ActivityThread.currentActivityThread().getHandler().post(() -> {
|
||||
// If the tracked window token is detached, release all views attached to this token.
|
||||
WindowManagerGlobal.getInstance().closeAll(WindowTokenClient.this,
|
||||
"#onWindowTokenRemoved()", "WindowTokenClient");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user