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

Commit d4701989 authored by Chris Göllner's avatar Chris Göllner
Browse files

LightBarController: directly inject BiometricUnlockController

Before, it was being set by CentralSurfacesImpl. The class is injectable
and can be directly injected.

Test: Manually - Build & Run
Test: LightBarControllerTest
Test: CentralSurfacesImplTest
Bug: 369337696
Flag: EXEMPT no behavior change
Change-Id: I75f3c5608a5ff43985f66e40a07654a73ec62e48
parent 88228a8a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -98,7 +98,8 @@ public class LightBarControllerTest extends SysuiTestCase {
                mock(NavigationModeController.class),
                mStatusBarModeRepository,
                mock(DumpManager.class),
                mTestScope.getCoroutineContext());
                mTestScope.getCoroutineContext(),
                mock(BiometricUnlockController.class));
        mLightBarController.start();
    }

+0 −2
Original line number Diff line number Diff line
@@ -1589,8 +1589,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
                .setStatusBarKeyguardViewManager(mStatusBarKeyguardViewManager);
        mBiometricUnlockController.setKeyguardViewController(mStatusBarKeyguardViewManager);
        mRemoteInputManager.addControllerCallback(mStatusBarKeyguardViewManager);

        mLightBarController.setBiometricUnlockController(mBiometricUnlockController);
        Trace.endSection();
    }

+0 −2
Original line number Diff line number Diff line
@@ -28,8 +28,6 @@ interface LightBarController : CoreStartable {

    fun setNavigationBar(navigationBar: LightBarTransitionsController)

    fun setBiometricUnlockController(biometricUnlockController: BiometricUnlockController)

    fun onNavigationBarAppearanceChanged(
        @WindowInsetsController.Appearance appearance: Int,
        nbModeChanged: Boolean,
+4 −11
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ public class LightBarControllerImpl implements
    private final DumpManager mDumpManager;
    private final StatusBarModePerDisplayRepository mStatusBarModeRepository;
    private final CoroutineContext mMainContext;
    private BiometricUnlockController mBiometricUnlockController;
    private final BiometricUnlockController mBiometricUnlockController;

    private LightBarTransitionsController mNavigationBarController;
    private @Appearance int mAppearance;
@@ -138,7 +138,8 @@ public class LightBarControllerImpl implements
            NavigationModeController navModeController,
            @Assisted StatusBarModePerDisplayRepository statusBarModeRepository,
            DumpManager dumpManager,
            @Main CoroutineContext mainContext) {
            @Main CoroutineContext mainContext,
            BiometricUnlockController biometricUnlockController) {
        mCoroutineScope = coroutineScope;
        mStatusBarIconController = (SysuiDarkIconDispatcher) darkIconDispatcher;
        mBatteryController = batteryController;
@@ -146,6 +147,7 @@ public class LightBarControllerImpl implements
        mDumpManager = dumpManager;
        mStatusBarModeRepository = statusBarModeRepository;
        mMainContext = mainContext;
        mBiometricUnlockController = biometricUnlockController;
        String dumpableNameSuffix =
                displayId == Display.DEFAULT_DISPLAY ? "" : String.valueOf(displayId);
        mDumpableName = getClass().getSimpleName() + dumpableNameSuffix;
@@ -176,12 +178,6 @@ public class LightBarControllerImpl implements
        updateNavigation();
    }

    @Override
    public void setBiometricUnlockController(
            BiometricUnlockController biometricUnlockController) {
        mBiometricUnlockController = biometricUnlockController;
    }

    private void onStatusBarAppearanceChanged(@Nullable StatusBarAppearance params) {
        if (params == null) {
            return;
@@ -388,9 +384,6 @@ public class LightBarControllerImpl implements
    }

    private boolean animateChange() {
        if (mBiometricUnlockController == null) {
            return false;
        }
        int unlockMode = mBiometricUnlockController.getMode();
        return unlockMode != BiometricUnlockController.MODE_WAKE_AND_UNLOCK_PULSING
                && unlockMode != BiometricUnlockController.MODE_WAKE_AND_UNLOCK;