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

Commit ce9dc350 authored by Matt Pietal's avatar Matt Pietal
Browse files

Don't run sim check in tests

It creates a new thread, which can have bad results
with mocks.

Fixes: 414388995
Test: atest KeyguardSimPinViewController
Flag: EXEMPT bugfix
Change-Id: I0edec8b92e071efc6a432e0337359f124a833d3e
parent 6a740a37
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -111,6 +111,7 @@ class KeyguardSimPinViewControllerTest : SysuiTestCase() {
                mUserActivityNotifier,
                inputManager,
            )
        underTest.mIsInTestMode = true
        underTest.init()
        underTest.onViewAttached()
        underTest.onResume(0)
+3 −0
Original line number Diff line number Diff line
@@ -68,6 +68,8 @@ public class KeyguardSimPinViewController
    private AlertDialog mRemainingAttemptsDialog;
    private ImageView mSimImageView;

    protected boolean mIsInTestMode = false;

    KeyguardUpdateMonitorCallback mUpdateMonitorCallback = new KeyguardUpdateMonitorCallback() {
        @Override
        public void onSimStateChanged(int subId, int slotId, int simState) {
@@ -321,6 +323,7 @@ public class KeyguardSimPinViewController

        @Override
        public void run() {
            if (mIsInTestMode) return;
            Log.v(TAG, "call supplyIccLockPin(subid=" + mSubId + ")");
            TelephonyManager telephonyManager = mTelephonyManager.createForSubscriptionId(mSubId);
            final PinResult result = telephonyManager.supplyIccLockPin(mPin);