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

Commit d73410a0 authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Fix NSWC goingAway flag

The flag was not being set after dismissing the keyguard, now it's
updated right after the keyguard is gone.

I also used the opportunity to remove Dependency and fix a new
dump regression.

Test: atest NotificationShadeWindowControllerTest
Test: atest NewNotifPipelineBubbleControllerTest
Test: atest KeyguardViewMediatorTest
Test: unlock with PIN
test: unlock with fingerprint from LS and AOD
Fixes: 149402864
Change-Id: I279a2a92f19cfef48663fe364765e28ac248a303
parent ebd361c2
Loading
Loading
Loading
Loading
+14 −11
Original line number Diff line number Diff line
@@ -80,7 +80,8 @@ import com.android.keyguard.KeyguardSecurityView;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.keyguard.KeyguardUpdateMonitorCallback;
import com.android.keyguard.ViewMediatorCallback;
import com.android.systemui.Dependency;
import com.android.systemui.DumpController;
import com.android.systemui.Dumpable;
import com.android.systemui.R;
import com.android.systemui.SystemUI;
import com.android.systemui.SystemUIFactory;
@@ -144,7 +145,7 @@ import dagger.Lazy;
 * directly to the keyguard UI is posted to a {@link android.os.Handler} to ensure it is taken on the UI
 * thread of the keyguard.
 */
public class KeyguardViewMediator extends SystemUI {
public class KeyguardViewMediator extends SystemUI implements Dumpable {
    private static final int KEYGUARD_DISPLAY_TIMEOUT_DELAY_DEFAULT = 30000;
    private static final long KEYGUARD_DONE_PENDING_TIMEOUT_MS = 3000;

@@ -222,10 +223,10 @@ public class KeyguardViewMediator extends SystemUI {
    private final FalsingManager mFalsingManager;

    /** High level access to the power manager for WakeLocks */
    private PowerManager mPM;
    private final PowerManager mPM;

    /** TrustManager for letting it know when we change visibility */
    private TrustManager mTrustManager;
    private final TrustManager mTrustManager;

    /**
     * Used to keep the device awake while to ensure the keyguard finishes opening before
@@ -283,7 +284,7 @@ public class KeyguardViewMediator extends SystemUI {

    // the properties of the keyguard

    private KeyguardUpdateMonitor mUpdateMonitor;
    private final KeyguardUpdateMonitor mUpdateMonitor;

    /**
     * Last SIM state reported by the telephony system.
@@ -610,6 +611,7 @@ public class KeyguardViewMediator extends SystemUI {
        @Override
        public void keyguardGone() {
            Trace.beginSection("KeyguardViewMediator.mViewMediatorCallback#keyguardGone");
            mNotificationShadeWindowController.setKeyguardGoingAway(false);
            mKeyguardDisplayManager.hide();
            Trace.endSection();
        }
@@ -696,7 +698,9 @@ public class KeyguardViewMediator extends SystemUI {
            NotificationShadeWindowController notificationShadeWindowController,
            Lazy<StatusBarKeyguardViewManager> statusBarKeyguardViewManagerLazy,
            DismissCallbackRegistry dismissCallbackRegistry,
            @UiBackground Executor uiBgExecutor) {
            KeyguardUpdateMonitor keyguardUpdateMonitor, DumpController dumpController,
            @UiBackground Executor uiBgExecutor, PowerManager powerManager,
            TrustManager trustManager) {
        super(context);
        mFalsingManager = falsingManager;
        mLockPatternUtils = lockPatternUtils;
@@ -705,6 +709,10 @@ public class KeyguardViewMediator extends SystemUI {
        mStatusBarKeyguardViewManagerLazy = statusBarKeyguardViewManagerLazy;
        mDismissCallbackRegistry = dismissCallbackRegistry;
        mUiBgExecutor = uiBgExecutor;
        mUpdateMonitor = keyguardUpdateMonitor;
        mPM = powerManager;
        mTrustManager = trustManager;
        dumpController.registerDumpable(this);
        mShowHomeOverLockscreen = DeviceConfig.getBoolean(
                DeviceConfig.NAMESPACE_SYSTEMUI,
                NAV_BAR_HANDLE_SHOW_OVER_LOCKSCREEN,
@@ -731,9 +739,6 @@ public class KeyguardViewMediator extends SystemUI {
    }

    private void setupLocked() {
        mPM = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
        mTrustManager = mContext.getSystemService(TrustManager.class);

        mShowKeyguardWakeLock = mPM.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "show keyguard");
        mShowKeyguardWakeLock.setReferenceCounted(false);

@@ -754,8 +759,6 @@ public class KeyguardViewMediator extends SystemUI {

        mAlarmManager = (AlarmManager) mContext.getSystemService(Context.ALARM_SERVICE);

        mUpdateMonitor = Dependency.get(KeyguardUpdateMonitor.class);

        KeyguardUpdateMonitor.setCurrentUser(ActivityManager.getCurrentUser());

        // Assume keyguard is showing (unless it's disabled) until we know for sure, unless Keyguard
+13 −1
Original line number Diff line number Diff line
@@ -16,9 +16,13 @@

package com.android.systemui.keyguard.dagger;

import android.app.trust.TrustManager;
import android.content.Context;
import android.os.PowerManager;

import com.android.internal.widget.LockPatternUtils;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.systemui.DumpController;
import com.android.systemui.broadcast.BroadcastDispatcher;
import com.android.systemui.dagger.qualifiers.UiBackground;
import com.android.systemui.keyguard.DismissCallbackRegistry;
@@ -54,6 +58,10 @@ public class KeyguardModule {
            NotificationShadeWindowController notificationShadeWindowController,
            Lazy<StatusBarKeyguardViewManager> statusBarKeyguardViewManagerLazy,
            DismissCallbackRegistry dismissCallbackRegistry,
            KeyguardUpdateMonitor updateMonitor,
            DumpController dumpController,
            PowerManager powerManager,
            TrustManager trustManager,
            @UiBackground Executor uiBgExecutor) {
        return new KeyguardViewMediator(
                context,
@@ -63,6 +71,10 @@ public class KeyguardModule {
                notificationShadeWindowController,
                statusBarKeyguardViewManagerLazy,
                dismissCallbackRegistry,
                uiBgExecutor);
                updateMonitor,
                dumpController,
                uiBgExecutor,
                powerManager,
                trustManager);
    }
}
+5 −2
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;

import com.android.systemui.DumpController;
import com.android.systemui.Dumpable;
import com.android.systemui.R;
import com.android.systemui.colorextraction.SysuiColorExtractor;
@@ -101,7 +102,8 @@ public class NotificationShadeWindowController implements Callback, Dumpable,
            IActivityManager activityManager, DozeParameters dozeParameters,
            StatusBarStateController statusBarStateController,
            ConfigurationController configurationController,
            KeyguardBypassController keyguardBypassController, SysuiColorExtractor colorExtractor) {
            KeyguardBypassController keyguardBypassController, SysuiColorExtractor colorExtractor,
            DumpController dumpController) {
        mContext = context;
        mWindowManager = windowManager;
        mActivityManager = activityManager;
@@ -111,6 +113,7 @@ public class NotificationShadeWindowController implements Callback, Dumpable,
        mLpChanged = new LayoutParams();
        mKeyguardBypassController = keyguardBypassController;
        mColorExtractor = colorExtractor;
        dumpController.registerDumpable(this);

        mLockScreenDisplayTimeout = context.getResources()
                .getInteger(R.integer.config_lockScreenDisplayTimeout);
@@ -594,7 +597,7 @@ public class NotificationShadeWindowController implements Callback, Dumpable,
    }

    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        pw.println("StatusBarWindowController:");
        pw.println(TAG + ":");
        pw.println("  mKeyguardDisplayMode=" + mKeyguardDisplayMode);
        pw.println(mCurrentState);
    }
+2 −1
Original line number Diff line number Diff line
@@ -203,7 +203,8 @@ public class BubbleControllerTest extends SysuiTestCase {
        // Bubbles get added to status bar window view
        mNotificationShadeWindowController = new NotificationShadeWindowController(mContext,
                mWindowManager, mActivityManager, mDozeParameters, mStatusBarStateController,
                mConfigurationController, mKeyguardBypassController, mColorExtractor);
                mConfigurationController, mKeyguardBypassController, mColorExtractor,
                mDumpController);
        mNotificationShadeWindowController.setNotificationShadeView(
                mSuperStatusBarViewFactory.getNotificationShadeWindowView());
        mNotificationShadeWindowController.attach();
+2 −1
Original line number Diff line number Diff line
@@ -197,7 +197,8 @@ public class NewNotifPipelineBubbleControllerTest extends SysuiTestCase {
        // Bubbles get added to status bar window view
        mNotificationShadeWindowController = new NotificationShadeWindowController(mContext,
                mWindowManager, mActivityManager, mDozeParameters, mStatusBarStateController,
                mConfigurationController, mKeyguardBypassController, mColorExtractor);
                mConfigurationController, mKeyguardBypassController, mColorExtractor,
                mDumpController);
        mNotificationShadeWindowController.setNotificationShadeView(
                mSuperStatusBarViewFactory.getNotificationShadeWindowView());
        mNotificationShadeWindowController.attach();
Loading