From 03a88d78f050dba16e5b8fe87a960a9dfaec8609 Mon Sep 17 00:00:00 2001 From: Alex Stetson Date: Wed, 13 Apr 2022 11:40:01 -0700 Subject: [PATCH] Use KeyguardViewController for SystemUIDialogManager Certain SystemUI instances do not support the StatusBarKeyguardViewManager class. Using the more generic KeyguardViewController will allow SystemUIDialogs to work properly under these circumstances. Bug: 227350805 Test: manual Change-Id: Ib5e109df3269f1e93d2c519787724af82bedfcc9 --- .../src/com/android/keyguard/KeyguardViewController.java | 5 +++++ .../statusbar/phone/StatusBarKeyguardViewManager.java | 4 +--- .../systemui/statusbar/phone/SystemUIDialogManager.java | 9 +++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardViewController.java index 295d77d55b568..ca8728aecb4cb 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardViewController.java @@ -54,6 +54,11 @@ public interface KeyguardViewController { */ void reset(boolean hideBouncerWhenShowing); + /** + * Stop showing any alternate auth methods. + */ + void resetAlternateAuth(boolean forceUpdateScrim); + /** * Called when the device started going to sleep. */ diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java index ce1289e0885cd..641448750b8fe 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java @@ -580,9 +580,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb } } - /** - * Stop showing any alternate auth methods - */ + @Override public void resetAlternateAuth(boolean forceUpdateScrim) { final boolean updateScrim = (mAlternateAuthInterceptor != null && mAlternateAuthInterceptor.hideAlternateAuthBouncer()) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialogManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialogManager.java index 36e705a31a108..e7d9221ac861d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialogManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialogManager.java @@ -18,6 +18,7 @@ package com.android.systemui.statusbar.phone; import androidx.annotation.NonNull; +import com.android.keyguard.KeyguardViewController; import com.android.systemui.Dumpable; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dump.DumpManager; @@ -37,7 +38,7 @@ import javax.inject.Inject; */ @SysUISingleton public class SystemUIDialogManager implements Dumpable { - private final StatusBarKeyguardViewManager mKeyguardViewManager; + private final KeyguardViewController mKeyguardViewController; private final Set mDialogsShowing = new HashSet<>(); private final Set mListeners = new HashSet<>(); @@ -45,9 +46,9 @@ public class SystemUIDialogManager implements Dumpable { @Inject public SystemUIDialogManager( DumpManager dumpManager, - StatusBarKeyguardViewManager statusBarKeyguardViewManager) { + KeyguardViewController keyguardViewController) { dumpManager.registerDumpable(this); - mKeyguardViewManager = statusBarKeyguardViewManager; + mKeyguardViewController = keyguardViewController; } /** @@ -86,7 +87,7 @@ public class SystemUIDialogManager implements Dumpable { private void updateDialogListeners() { if (shouldHideAffordance()) { - mKeyguardViewManager.resetAlternateAuth(true); + mKeyguardViewController.resetAlternateAuth(true); } for (Listener listener : mListeners) {