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

Commit f2dc70b4 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix NSWC goingAway flag"

parents 93e844f3 d73410a0
Loading
Loading
Loading
Loading
+14 −11
Original line number Original line Diff line number Diff line
@@ -80,7 +80,8 @@ import com.android.keyguard.KeyguardSecurityView;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.keyguard.KeyguardUpdateMonitorCallback;
import com.android.keyguard.KeyguardUpdateMonitorCallback;
import com.android.keyguard.ViewMediatorCallback;
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.R;
import com.android.systemui.SystemUI;
import com.android.systemui.SystemUI;
import com.android.systemui.SystemUIFactory;
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
 * 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.
 * 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 int KEYGUARD_DISPLAY_TIMEOUT_DELAY_DEFAULT = 30000;
    private static final long KEYGUARD_DONE_PENDING_TIMEOUT_MS = 3000;
    private static final long KEYGUARD_DONE_PENDING_TIMEOUT_MS = 3000;


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


    /** High level access to the power manager for WakeLocks */
    /** 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 */
    /** 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
     * 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
    // the properties of the keyguard


    private KeyguardUpdateMonitor mUpdateMonitor;
    private final KeyguardUpdateMonitor mUpdateMonitor;


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


    private void setupLocked() {
    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 = mPM.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "show keyguard");
        mShowKeyguardWakeLock.setReferenceCounted(false);
        mShowKeyguardWakeLock.setReferenceCounted(false);


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


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


        mUpdateMonitor = Dependency.get(KeyguardUpdateMonitor.class);

        KeyguardUpdateMonitor.setCurrentUser(ActivityManager.getCurrentUser());
        KeyguardUpdateMonitor.setCurrentUser(ActivityManager.getCurrentUser());


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


package com.android.systemui.keyguard.dagger;
package com.android.systemui.keyguard.dagger;


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


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


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


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


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