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

Commit e3f30d8f authored by Chienyuan's avatar Chienyuan
Browse files

HFP: Check sim state when subscriptions changed

onSignalStrengthsChanged and onServiceStateChanged will not be triggered
when sim card be removed. Check sim state when subscriptions changed and
update service/signal state to remote device.

Bug: 146391618
Test: manual, connect carkit then remove sim

Change-Id: I13a188a7dd831404368b4e4f82eff89df731ec46
parent a6b5cc4c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -267,6 +267,12 @@ public class HeadsetPhoneState {
        @Override
        public void onSubscriptionsChanged() {
            synchronized (mDeviceEventMap) {
                int simState = mTelephonyManager.getSimState();
                if (simState != TelephonyManager.SIM_STATE_READY) {
                    mCindSignal = 0;
                    mCindService = HeadsetHalConstants.NETWORK_STATE_NOT_AVAILABLE;
                    sendDeviceStateChanged();
                }
                stopListenForPhoneState();
                startListenForPhoneState();
            }