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

Commit 98df697e authored by Heemin Seog's avatar Heemin Seog
Browse files

Remove some keyguard methods out of ShadeController

There are a few keyguard related methods which redirected through
ShadeController somewhat arbitrarily.

This CL moves some of these out of ShadeController to various places
(StatusBar, StatusBarKeyguardViewManager, StatusBarStateController, etc)

Bug: 144702768
Test: manual, atest SystemUITests
Change-Id: Iba4ca37053363a9e952c8a642730521db19cb05b
parent e9f4e96c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2989,7 +2989,7 @@ public class NotificationPanelView extends PanelView implements
                return true;
            case StatusBarState.SHADE_LOCKED:
                if (!mQsExpanded) {
                    mShadeController.goToKeyguard();
                    mStatusBarStateController.setState(StatusBarState.KEYGUARD);
                }
                return true;
            case StatusBarState.SHADE:
+0 −32
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@ package com.android.systemui.statusbar.phone;
import android.view.View;

import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.notification.row.ActivatableNotificationView;

/**
 * {@link ShadeController} is an abstraction of the work that used to be hard-coded in
@@ -28,14 +27,6 @@ import com.android.systemui.statusbar.notification.row.ActivatableNotificationVi
 */
public interface ShadeController {

    /**
     * Shows the keyguard bouncer - the password challenge on the lock screen
     *
     * @param scrimmed true when the bouncer should show scrimmed, false when the user will be
     * dragging it and translation should be deferred {@see KeyguardBouncer#show(boolean, boolean)}
     */
    void showBouncer(boolean scrimmed);

    /**
     * Make our window larger and the panel expanded
     */
@@ -69,12 +60,6 @@ public interface ShadeController {
     */
    void addPostCollapseAction(Runnable action);

    /**
     * Ask shade controller to set the state to {@link StatusBarState#KEYGUARD}, but only from
     * {@link StatusBarState#SHADE_LOCKED}
     */
    void goToKeyguard();

    /**
     * Notify the shade controller that the current user changed
     *
@@ -91,11 +76,6 @@ public interface ShadeController {
     */
    void goToLockedShade(View startingChild);

    /**
     * Adds a {@param runnable} to be executed after Keyguard is gone.
     */
    void addAfterKeyguardGoneRunnable(Runnable runnable);

    /**
     * Close the shade if it was open
     *
@@ -110,16 +90,4 @@ public interface ShadeController {
     * @param animate
     */
    void collapsePanel(boolean animate);

    /**
     * Callback to tell the shade controller that an activity launch animation was canceled
     */
    void onLaunchAnimationCancelled();

    /**
     * Callback to notify the shade controller that a {@link ActivatableNotificationView} has become
     * inactive
     */
    void onActivationReset();

}
+3 −25
Original line number Diff line number Diff line
@@ -1239,6 +1239,7 @@ public class StatusBar extends SystemUI implements DemoMode,
                mHeadsUpManager, mStatusBarWindow, mStackScroller, mDozeScrimController,
                mScrimController, mActivityLaunchAnimator, mDynamicPrivacyController,
                mNotificationAlertingManager, rowBinder, mKeyguardStateController,
                mKeyguardIndicationController,
                this /* statusBar */, mCommandQueue);

        mNotificationListController =
@@ -1282,11 +1283,6 @@ public class StatusBar extends SystemUI implements DemoMode,
        mCommandQueue.disable(mDisplayId, state1, state2, false /* animate */);
    }

    @Override
    public void addAfterKeyguardGoneRunnable(Runnable runnable) {
        mStatusBarKeyguardViewManager.addAfterKeyguardGoneRunnable(runnable);
    }

    /**
     * Ask the display to wake up if currently dozing, else do nothing
     *
@@ -3454,15 +3450,10 @@ public class StatusBar extends SystemUI implements DemoMode,
    private void showBouncerIfKeyguard() {
        if ((mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED)
                && !mKeyguardViewMediator.isHiding()) {
            showBouncer(true /* scrimmed */);
            mStatusBarKeyguardViewManager.showBouncer(true /* scrimmed */);
        }
    }

    @Override
    public void showBouncer(boolean scrimmed) {
        mStatusBarKeyguardViewManager.showBouncer(scrimmed);
    }

    @Override
    public void instantExpandNotificationsPanel() {
        // Make our window larger and the panel expanded.
@@ -3584,10 +3575,6 @@ public class StatusBar extends SystemUI implements DemoMode,
                mStatusBarKeyguardViewManager.isOccluded());
    }

    public void onActivationReset() {
        mKeyguardIndicationController.hideTransientIndication();
    }

    public void onTrackingStarted() {
        runPostCollapseRunnables();
    }
@@ -3629,7 +3616,7 @@ public class StatusBar extends SystemUI implements DemoMode,
    public void onTrackingStopped(boolean expand) {
        if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
            if (!expand && !mKeyguardStateController.canDismissLockScreen()) {
                showBouncer(false /* scrimmed */);
                mStatusBarKeyguardViewManager.showBouncer(false /* scrimmed */);
            }
        }
    }
@@ -3688,15 +3675,6 @@ public class StatusBar extends SystemUI implements DemoMode,
        }
    }

    /**
     * Goes back to the keyguard after hanging around in {@link StatusBarState#SHADE_LOCKED}.
     */
    public void goToKeyguard() {
        if (mState == StatusBarState.SHADE_LOCKED) {
            mStatusBarStateController.setState(StatusBarState.KEYGUARD);
        }
    }

    /**
     * Propagation of the bouncer state, indicating that it's fully visible.
     */
+6 −0
Original line number Diff line number Diff line
@@ -365,6 +365,12 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
        cancelPendingWakeupAction();
    }

    /**
     * Shows the keyguard bouncer - the password challenge on the lock screen
     *
     * @param scrimmed true when the bouncer should show scrimmed, false when the user will be
     * dragging it and translation should be deferred {@see KeyguardBouncer#show(boolean, boolean)}
     */
    public void showBouncer(boolean scrimmed) {
        if (mShowing && !mBouncer.isShowing()) {
            mBouncer.show(false /* resetSecuritySelection */, scrimmed);
+10 −2
Original line number Diff line number Diff line
@@ -105,6 +105,7 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
    private final NotificationPresenter mPresenter;
    private final LockPatternUtils mLockPatternUtils;
    private final HeadsUpManagerPhone mHeadsUpManager;
    private final StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
    private final KeyguardManager mKeyguardManager;
    private final ActivityLaunchAnimator mActivityLaunchAnimator;
    private final IStatusBarService mBarService;
@@ -122,7 +123,9 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
            NotificationPresenter presenter, NotificationEntryManager entryManager,
            HeadsUpManagerPhone headsUpManager, ActivityStarter activityStarter,
            ActivityLaunchAnimator activityLaunchAnimator, IStatusBarService statusBarService,
            StatusBarStateController statusBarStateController, KeyguardManager keyguardManager,
            StatusBarStateController statusBarStateController,
            StatusBarKeyguardViewManager statusBarKeyguardViewManager,
            KeyguardManager keyguardManager,
            IDreamManager dreamManager, NotificationRemoteInputManager remoteInputManager,
            StatusBarRemoteInputCallback remoteInputCallback, NotificationGroupManager groupManager,
            NotificationLockscreenUserManager lockscreenUserManager,
@@ -139,6 +142,7 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
        mActivityLaunchAnimator = activityLaunchAnimator;
        mBarService = statusBarService;
        mCommandQueue = commandQueue;
        mStatusBarKeyguardViewManager = statusBarKeyguardViewManager;
        mKeyguardManager = keyguardManager;
        mDreamManager = dreamManager;
        mRemoteInputManager = remoteInputManager;
@@ -258,7 +262,7 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
            mShadeController.collapsePanel(true /* animate */);
        } else if (mKeyguardStateController.isShowing()
                && mStatusBar.isOccluded()) {
            mShadeController.addAfterKeyguardGoneRunnable(runnable);
            mStatusBarKeyguardViewManager.addAfterKeyguardGoneRunnable(runnable);
            mShadeController.collapsePanel();
        } else {
            mBackgroundHandler.postAtFrontOfQueue(runnable);
@@ -504,6 +508,7 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
        private final ActivityStarter mActivityStarter;
        private final IStatusBarService mStatusBarService;
        private final StatusBarStateController mStatusBarStateController;
        private final StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
        private final KeyguardManager mKeyguardManager;
        private final IDreamManager mDreamManager;
        private final NotificationRemoteInputManager mRemoteInputManager;
@@ -533,6 +538,7 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
                ActivityStarter activityStarter,
                IStatusBarService statusBarService,
                StatusBarStateController statusBarStateController,
                StatusBarKeyguardViewManager statusBarKeyguardViewManager,
                KeyguardManager keyguardManager,
                IDreamManager dreamManager,
                NotificationRemoteInputManager remoteInputManager,
@@ -556,6 +562,7 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
            mActivityStarter = activityStarter;
            mStatusBarService = statusBarService;
            mStatusBarStateController = statusBarStateController;
            mStatusBarKeyguardViewManager = statusBarKeyguardViewManager;
            mKeyguardManager = keyguardManager;
            mDreamManager = dreamManager;
            mRemoteInputManager = remoteInputManager;
@@ -601,6 +608,7 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
                    mActivityLaunchAnimator,
                    mStatusBarService,
                    mStatusBarStateController,
                    mStatusBarKeyguardViewManager,
                    mKeyguardManager,
                    mDreamManager,
                    mRemoteInputManager,
Loading