From 1d74d88488231ecb4a647000f1fd2a077b727fa4 Mon Sep 17 00:00:00 2001 From: Jerry Chang Date: Thu, 10 Sep 2020 18:15:00 +0800 Subject: [PATCH] Fix divider bar floating on keyguard panel After migration, we use KeyguardUpdateMonitor.registerCallback() instead of using KeyguardStateController.addCallback() to monitor keyguard's visibility changes. Since KeyguardUpdateMonitor recrods registered callbacks with weak reference, the callbacks might be GCed if there's no other reference. Fix: 168271350 Test: atest WMShellTest Test: check divider bar disappears everytime when keyguard showing Test: check it'll leave one handed mode everytime when keyguard showing Change-Id: I23ca7e40c59211cbeafb09105f95ae2d1a919031 --- .../src/com/android/systemui/wmshell/WMShell.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/wmshell/WMShell.java b/packages/SystemUI/src/com/android/systemui/wmshell/WMShell.java index 98c0b1e99fc49..c46cf7b5e851d 100644 --- a/packages/SystemUI/src/com/android/systemui/wmshell/WMShell.java +++ b/packages/SystemUI/src/com/android/systemui/wmshell/WMShell.java @@ -78,6 +78,9 @@ public final class WMShell extends SystemUI implements ProtoTraceable mOneHandedOptional; private final ProtoTracer mProtoTracer; + private KeyguardUpdateMonitorCallback mSplitScreenKeyguardCallback; + private KeyguardUpdateMonitorCallback mOneHandedKeyguardCallback; + @Inject public WMShell(Context context, CommandQueue commandQueue, KeyguardUpdateMonitor keyguardUpdateMonitor, @@ -128,7 +131,7 @@ public final class WMShell extends SystemUI implements ProtoTraceable