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

Commit 5abb6f4e authored by Beverly's avatar Beverly
Browse files

Refactor LockScreenLockIconController

To help with KeyguardIndicationController refactor.

Also, allow lock icon to always show if we're not showing the new
lockscreen layout

Test: atest SystemUITests
Bug: 178794517
Change-Id: Ibd206c93dd3fb6c70e2ca422209fb79b8dc6eb09
parent 5e8177bf
Loading
Loading
Loading
Loading
+7 −5
Original line number Original line Diff line number Diff line
@@ -1909,13 +1909,15 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
    }
    }


    /**
    /**
     * Whether to show the lock icon on lock screen and bouncer. This depends on the enrolled
     * Whether to show the lock icon on lock screen and bouncer.
     * biometrics to the device.
     */
     */
    public boolean shouldShowLockIcon() {
    public boolean canShowLockIcon() {
        if (mLockScreenMode == LOCK_SCREEN_MODE_LAYOUT_1) {
            return isFaceAuthEnabledForUser(KeyguardUpdateMonitor.getCurrentUser())
            return isFaceAuthEnabledForUser(KeyguardUpdateMonitor.getCurrentUser())
                    && !isUdfpsEnrolled();
                    && !isUdfpsEnrolled();
        }
        }
        return true;
    }


    /**
    /**
     * @return true if there's at least one udfps enrolled
     * @return true if there's at least one udfps enrolled
+1 −10
Original line number Original line Diff line number Diff line
@@ -23,8 +23,6 @@ import android.view.ViewGroup;
import com.android.systemui.R;
import com.android.systemui.R;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.statusbar.notification.row.dagger.NotificationShelfComponent;
import com.android.systemui.statusbar.notification.row.dagger.NotificationShelfComponent;
import com.android.systemui.statusbar.phone.LockIcon;
import com.android.systemui.statusbar.phone.LockscreenLockIconController;
import com.android.systemui.statusbar.phone.NotificationPanelView;
import com.android.systemui.statusbar.phone.NotificationPanelView;
import com.android.systemui.statusbar.phone.NotificationShadeWindowView;
import com.android.systemui.statusbar.phone.NotificationShadeWindowView;
import com.android.systemui.statusbar.phone.StatusBarWindowView;
import com.android.systemui.statusbar.phone.StatusBarWindowView;
@@ -41,7 +39,6 @@ public class SuperStatusBarViewFactory {


    private final Context mContext;
    private final Context mContext;
    private final InjectionInflationController mInjectionInflationController;
    private final InjectionInflationController mInjectionInflationController;
    private final LockscreenLockIconController mLockIconController;
    private final NotificationShelfComponent.Builder mNotificationShelfComponentBuilder;
    private final NotificationShelfComponent.Builder mNotificationShelfComponentBuilder;


    private NotificationShadeWindowView mNotificationShadeWindowView;
    private NotificationShadeWindowView mNotificationShadeWindowView;
@@ -51,11 +48,9 @@ public class SuperStatusBarViewFactory {
    @Inject
    @Inject
    public SuperStatusBarViewFactory(Context context,
    public SuperStatusBarViewFactory(Context context,
            InjectionInflationController injectionInflationController,
            InjectionInflationController injectionInflationController,
            NotificationShelfComponent.Builder notificationShelfComponentBuilder,
            NotificationShelfComponent.Builder notificationShelfComponentBuilder) {
            LockscreenLockIconController lockIconController) {
        mContext = context;
        mContext = context;
        mInjectionInflationController = injectionInflationController;
        mInjectionInflationController = injectionInflationController;
        mLockIconController = lockIconController;
        mNotificationShelfComponentBuilder = notificationShelfComponentBuilder;
        mNotificationShelfComponentBuilder = notificationShelfComponentBuilder;
    }
    }


@@ -77,10 +72,6 @@ public class SuperStatusBarViewFactory {
            throw new IllegalStateException(
            throw new IllegalStateException(
                    "R.layout.super_notification_shade could not be properly inflated");
                    "R.layout.super_notification_shade could not be properly inflated");
        }
        }
        LockIcon lockIcon = mNotificationShadeWindowView.findViewById(R.id.lock_icon);
        if (lockIcon != null) {
            mLockIconController.attach(lockIcon);
        }


        return mNotificationShadeWindowView;
        return mNotificationShadeWindowView;
    }
    }
+2 −5
Original line number Original line Diff line number Diff line
@@ -71,7 +71,7 @@ public final class DozeServiceHost implements DozeHost {
            "persist.sysui.wake_performs_auth", true);
            "persist.sysui.wake_performs_auth", true);
    private boolean mDozingRequested;
    private boolean mDozingRequested;
    private boolean mPulsing;
    private boolean mPulsing;
    private WakefulnessLifecycle mWakefulnessLifecycle;
    private final WakefulnessLifecycle mWakefulnessLifecycle;
    private final SysuiStatusBarStateController mStatusBarStateController;
    private final SysuiStatusBarStateController mStatusBarStateController;
    private final DeviceProvisionedController mDeviceProvisionedController;
    private final DeviceProvisionedController mDeviceProvisionedController;
    private final HeadsUpManagerPhone mHeadsUpManagerPhone;
    private final HeadsUpManagerPhone mHeadsUpManagerPhone;
@@ -86,9 +86,8 @@ public final class DozeServiceHost implements DozeHost {
    private final NotificationShadeWindowController mNotificationShadeWindowController;
    private final NotificationShadeWindowController mNotificationShadeWindowController;
    private final NotificationWakeUpCoordinator mNotificationWakeUpCoordinator;
    private final NotificationWakeUpCoordinator mNotificationWakeUpCoordinator;
    private NotificationShadeWindowViewController mNotificationShadeWindowViewController;
    private NotificationShadeWindowViewController mNotificationShadeWindowViewController;
    private final LockscreenLockIconController mLockscreenLockIconController;
    private final AuthController mAuthController;
    private final AuthController mAuthController;
    private NotificationIconAreaController mNotificationIconAreaController;
    private final NotificationIconAreaController mNotificationIconAreaController;
    private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
    private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
    private NotificationPanelViewController mNotificationPanel;
    private NotificationPanelViewController mNotificationPanel;
    private View mAmbientIndicationContainer;
    private View mAmbientIndicationContainer;
@@ -109,7 +108,6 @@ public final class DozeServiceHost implements DozeHost {
            PulseExpansionHandler pulseExpansionHandler,
            PulseExpansionHandler pulseExpansionHandler,
            NotificationShadeWindowController notificationShadeWindowController,
            NotificationShadeWindowController notificationShadeWindowController,
            NotificationWakeUpCoordinator notificationWakeUpCoordinator,
            NotificationWakeUpCoordinator notificationWakeUpCoordinator,
            LockscreenLockIconController lockscreenLockIconController,
            AuthController authController,
            AuthController authController,
            NotificationIconAreaController notificationIconAreaController) {
            NotificationIconAreaController notificationIconAreaController) {
        super();
        super();
@@ -129,7 +127,6 @@ public final class DozeServiceHost implements DozeHost {
        mPulseExpansionHandler = pulseExpansionHandler;
        mPulseExpansionHandler = pulseExpansionHandler;
        mNotificationShadeWindowController = notificationShadeWindowController;
        mNotificationShadeWindowController = notificationShadeWindowController;
        mNotificationWakeUpCoordinator = notificationWakeUpCoordinator;
        mNotificationWakeUpCoordinator = notificationWakeUpCoordinator;
        mLockscreenLockIconController = lockscreenLockIconController;
        mAuthController = authController;
        mAuthController = authController;
        mNotificationIconAreaController = notificationIconAreaController;
        mNotificationIconAreaController = notificationIconAreaController;
    }
    }
+253 −275

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Original line Diff line number Diff line
@@ -910,7 +910,7 @@ public class NotificationPanelViewController extends PanelViewController {
                    clockPreferredY, hasCustomClock(),
                    clockPreferredY, hasCustomClock(),
                    hasVisibleNotifications, mInterpolatedDarkAmount, mEmptyDragAmount,
                    hasVisibleNotifications, mInterpolatedDarkAmount, mEmptyDragAmount,
                    bypassEnabled, getUnlockedStackScrollerPadding(),
                    bypassEnabled, getUnlockedStackScrollerPadding(),
                    mUpdateMonitor.shouldShowLockIcon(),
                    mUpdateMonitor.canShowLockIcon(),
                    getQsExpansionFraction(),
                    getQsExpansionFraction(),
                    mDisplayCutoutTopInset);
                    mDisplayCutoutTopInset);
            mClockPositionAlgorithm.run(mClockPositionResult);
            mClockPositionAlgorithm.run(mClockPositionResult);
Loading