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

Commit 5e624074 authored by josephpv's avatar josephpv
Browse files

Add mocks for LockPatternUtils.isSecure() method in setup

This change adds mocking for LockPatternUtils.isSecure method in the
tests where SecurityFeatureProvider is referred in setup as per the
comment in b/323649600#comment7
The tests are passing locally even without this.

Bug: 333504640
Test: atest com.android.settings.privatespace
Change-Id: I7d9c3a8356dbf25cf09530ffb53712b3ab887160
parent c55cd952
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ public class FaceFingerprintUnlockControllerTest {
        final FakeFeatureFactory featureFactory = FakeFeatureFactory.setupForTest();
        when(featureFactory.securityFeatureProvider.getLockPatternUtils(mContext))
                .thenReturn(mLockPatternUtils);
        doReturn(true).when(mLockPatternUtils).isSecure(anyInt());

        mFaceFingerprintUnlockController =
                new FaceFingerprintUnlockController(mContext, mLifecycle);
+1 −0
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ public class PrivateSpaceLockControllerTest {
        final FakeFeatureFactory featureFactory = FakeFeatureFactory.setupForTest();
        when(featureFactory.securityFeatureProvider.getLockPatternUtils(mContext))
                .thenReturn(mLockPatternUtils);
        doReturn(true).when(mLockPatternUtils).isSecure(anyInt());

        mPrivateSpaceLockController = new PrivateSpaceLockController(mContext,
                mSettingsPreferenceFragment);
+1 −0
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ public class UseOneLockControllerTest {
        final FakeFeatureFactory featureFactory = FakeFeatureFactory.setupForTest();
        when(featureFactory.securityFeatureProvider.getLockPatternUtils(mContext))
                .thenReturn(mLockPatternUtils);
        doReturn(true).when(mLockPatternUtils).isSecure(anyInt());
        mUseOneLockController = new UseOneLockController(mContext, preferenceKey);

    }