Move onKeyguardGoingAway outside ActivityManager lock

The other events of WallpaperManagerInternal (onDisplayReady,
onScreenTurningOn, onScreenTurnedOn) are also called outside lock,
and only grab the WallpaperManagerService lock.

We now do the same with onKeyguardGoingAway. This does not create new
race issues: the event sent to the engine is anyway async.

This CL fixes a deadlock: see the associated bug.

Bug: 282786193
Test: treehugger
Change-Id: I8c15fec587c6124ee5aadac46b8a0e1b93507921
This commit is contained in:
Aurélien Pomini
2023-05-25 15:00:47 +00:00
parent 4422c68b14
commit 169a306c2e

View File

@@ -3558,10 +3558,10 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
mRootWindowContainer.forAllDisplays(displayContent -> {
mKeyguardController.keyguardGoingAway(displayContent.getDisplayId(), flags);
});
WallpaperManagerInternal wallpaperManagerInternal = getWallpaperManagerInternal();
if (wallpaperManagerInternal != null) {
wallpaperManagerInternal.onKeyguardGoingAway();
}
}
WallpaperManagerInternal wallpaperManagerInternal = getWallpaperManagerInternal();
if (wallpaperManagerInternal != null) {
wallpaperManagerInternal.onKeyguardGoingAway();
}
} finally {
Binder.restoreCallingIdentity(token);