Post callback onSecureWindowShown on the main thread
onSecureWindowShown will trigger a toast showing and might cause deadlock since showing a toast will acquire ActivityManagerService lock. Post onSecureWindowShown on the main thread, so it doesn't block activity launching. Bug: 244139910 Test: Manually test with Exo on multi-display environment Change-Id: Idf29b534a3657a265a5f389e0b388bc3af19c04e
This commit is contained in:
@@ -250,7 +250,9 @@ public class GenericWindowPolicyController extends DisplayWindowPolicyController
|
||||
// The callback is fired only when windowFlags are changed. To let VirtualDevice owner
|
||||
// aware that the virtual display has a secure window on top.
|
||||
if ((windowFlags & FLAG_SECURE) != 0) {
|
||||
mSecureWindowCallback.onSecureWindowShown(mDisplayId, activityInfo.applicationInfo.uid);
|
||||
// Post callback on the main thread, so it doesn't block activity launching.
|
||||
mHandler.post(() -> mSecureWindowCallback.onSecureWindowShown(mDisplayId,
|
||||
activityInfo.applicationInfo.uid));
|
||||
}
|
||||
|
||||
if (!canContainActivity(activityInfo, windowFlags, systemWindowFlags)) {
|
||||
|
||||
Reference in New Issue
Block a user