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

Commit 3fd1793c authored by Aaron Liu's avatar Aaron Liu
Browse files

Do not unregister keyguardupdatemonitor

on TextCarrierManager.

Also add a log in keyguardupdatemonitor to indicate that we are
propagating sim state changes.

Test: add invalid card
Test: atest CarrierTextManagerTest
Flag: NONE
Fixes: 321918644
Change-Id: I75e7e0234e05f44c9e25ae8d39f5512cba2d1cca
parent 0cdf6dea
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -206,6 +206,9 @@ public class CarrierTextManager {
                // This will set/remove the listeners appropriately. Note that it will never double
                // add the listeners.
                handleSetListening(mCarrierTextCallback);
                mainExecutor.execute(() -> {
                    mKeyguardUpdateMonitor.registerCallback(mCallback);
                });
            }
        });
    }
@@ -273,7 +276,6 @@ public class CarrierTextManager {
            if (mNetworkSupported.get()) {
                // Keyguard update monitor expects callbacks from main thread
                mMainExecutor.execute(() -> {
                    mKeyguardUpdateMonitor.registerCallback(mCallback);
                    mWakefulnessLifecycle.addObserver(mWakefulnessObserver);
                });
                mTelephonyListenerManager.addActiveDataSubscriptionIdListener(mPhoneStateListener);
@@ -286,7 +288,6 @@ public class CarrierTextManager {
        } else {
            mCarrierTextCallback = null;
            mMainExecutor.execute(() -> {
                mKeyguardUpdateMonitor.removeCallback(mCallback);
                mWakefulnessLifecycle.removeObserver(mWakefulnessObserver);
            });
            mTelephonyListenerManager.removeActiveDataSubscriptionIdListener(mPhoneStateListener);
+1 −0
Original line number Diff line number Diff line
@@ -3810,6 +3810,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab

        becameAbsent |= ABSENT_SIM_STATE_LIST.contains(state);

        // TODO(b/327476182): Preserve SIM_STATE_CARD_IO_ERROR sims in a separate data source.
        SimData data = mSimDatas.get(subId);
        final boolean changed;
        if (data == null) {