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

Commit c5770ff7 authored by Chen Xu's avatar Chen Xu Committed by Gerrit Code Review
Browse files

Merge "Checking 'phoneId' when sim status is changed"

parents 6890fa9e 5926bd32
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.os.Registrant;
import android.os.RegistrantList;
import android.provider.Settings;
import android.provider.Telephony;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.util.LocalLog;
import android.util.Log;
@@ -93,9 +94,13 @@ public class CarrierActionAgent extends Handler {
                    // ignore rebroadcast since carrier apps are direct boot aware.
                    return;
                }
                final int phoneId = intent.getIntExtra(PhoneConstants.PHONE_KEY,
                        SubscriptionManager.INVALID_PHONE_INDEX);
                if (mPhone.getPhoneId() == phoneId) {
                    sendMessage(obtainMessage(EVENT_SIM_STATE_CHANGED, iccState));
                }
            }
        }
    };

    /** Constructor */
+2 −0
Original line number Diff line number Diff line
@@ -92,6 +92,7 @@ public class CarrierActionAgentTest extends TelephonyTest {
        final Intent intent = new Intent(TelephonyIntents.ACTION_SIM_STATE_CHANGED);
        intent.putExtra(IccCardConstants.INTENT_KEY_ICC_STATE,
                IccCardConstants.INTENT_VALUE_ICC_LOADED);
        intent.putExtra(PhoneConstants.PHONE_KEY, mPhone.getPhoneId());
        mContext.sendBroadcast(intent);
        processAllMessages();

@@ -134,6 +135,7 @@ public class CarrierActionAgentTest extends TelephonyTest {
        final Intent intent = new Intent(TelephonyIntents.ACTION_SIM_STATE_CHANGED);
        intent.putExtra(IccCardConstants.INTENT_KEY_ICC_STATE,
                IccCardConstants.INTENT_VALUE_ICC_LOADED);
        intent.putExtra(PhoneConstants.PHONE_KEY, mPhone.getPhoneId());
        mContext.sendBroadcast(intent);
        processAllMessages();