From 7b712e2f1df3fb91c932557c59c167293efae33f Mon Sep 17 00:00:00 2001 From: Aditya Jadhav Date: Mon, 12 Jun 2023 16:43:35 +0530 Subject: [PATCH] Sometimes Screen does not wake up while receiving whatsapp video call Problem: { 1. Set wipe lock screen. Press power. Then quickly video call from whatsapp from other device. 2. Try for 15 to 20 times. Issue should occur. Try it on low end pixel device if possible. Its a race condition issue. Might now reproduce on high end devices 3. When updateVisibility#KeyguardController.java is called when app has not set show when locked, lastTurnScreenOnActivity gets assigned value mTopTurnScreenOnActivity. 4. This never resets again, and when actually the app sets show when locked and wants to wakeup the screen, lastTurnScreenOnActivity and mTopTurnScreenOnActivity are equal. 5. This condition check does not allow device to wake up. } Solution: { 1. Allow the device screen to wake up when app has set show when locked attribute. } Bug: 286776817 Change-Id: I55543d010115e3608eaf6d54c24e7800d3569a05 Signed-off-by: Aditya Jadhav --- .../core/java/com/android/server/wm/KeyguardController.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/KeyguardController.java b/services/core/java/com/android/server/wm/KeyguardController.java index 1d21b9d8c141d..283e12a6ddaf3 100644 --- a/services/core/java/com/android/server/wm/KeyguardController.java +++ b/services/core/java/com/android/server/wm/KeyguardController.java @@ -661,8 +661,7 @@ class KeyguardController { display.pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER; } - if (mTopTurnScreenOnActivity != lastTurnScreenOnActivity - && mTopTurnScreenOnActivity != null + if (mTopTurnScreenOnActivity != null && !mService.mWindowManager.mPowerManager.isInteractive() && (mRequestDismissKeyguard || occludedByActivity)) { controller.mTaskSupervisor.wakeUp("handleTurnScreenOn");