Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 5f10bcb6 authored by panhaihui's avatar panhaihui Committed by haihui pan
Browse files

[Bugfix] avoid deadLock caused by onAuthenticationPrompt()



call chain 1:
VirtualDeviceManagerService$LocalService.onAuthenticationPrompt() -> VirtualDeviceImpl.showToastWhereUidIsRunning() -> ... -> WindowManagerService.addWindowToken()

call chain 2:
RootWindowContainer.onDisplayAdded() ->  RootWindowContainer.getDisplayContentOrCreate() -> DisplayContent.<init> -> DisplayPolicy.<init> -> ContextImpl.createDisplayContext() -> ContextImpl.setDisplay() -> ... -> VirtualDeviceManager.getDeviceIdForDisplayId() -> VirtualDeviceManagerService.getVirtualDevicesSnapshot()

Getting mVirtualDeviceManagerLock first in onAuthenticationPrompt() and then getting WMS lock in addWindowToken() is an inappropriate lock order in the above call chain 1.  This is inconsistent with the method of getting WMS lock first and then mVirtualDeviceManagerLock in call chain 2. so it will cause deadlock and cause watchdog.

showToastWhereUidIsRunning should be executed outside the mVirtualDeviceManagerLock like in onCameraAccessBlocked() method to avoid deadlock.

Bug: 385854410
Test: Manual test

Change-Id: I087cdc184ddf3fb5548517ed6e1139809d3da6c3
Signed-off-by: default avatarpanhaihui <panhaihui@xiaomi.com>
parent 2f8b519d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment