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

Commit 5af137a1 authored by Amit Mahajan's avatar Amit Mahajan
Browse files

Allow background receivers to receive new SIM state intents.

This is to match the behavior with existing SIM_STATE_CHANGED
intent.

Test: Basic telephony sanity
Bug: 73832281
Merged-in: Iac030b55b12e43e6599830e802d51329c819e8a9
Change-Id: Iac030b55b12e43e6599830e802d51329c819e8a9
(cherry picked from commit 6b4142b7)
parent 7f278d54
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -862,6 +862,7 @@ public class SubscriptionInfoUpdater extends Handler {
            sSimCardState[phoneId] = state;
            Intent i = new Intent(TelephonyManager.ACTION_SIM_CARD_STATE_CHANGED);
            i.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
            i.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
            i.putExtra(TelephonyManager.EXTRA_SIM_STATE, state);
            SubscriptionManager.putPhoneIdAndSubIdExtra(i, phoneId);
            logd("Broadcasting intent ACTION_SIM_CARD_STATE_CHANGED " + simStateString(state)
@@ -879,6 +880,7 @@ public class SubscriptionInfoUpdater extends Handler {
                && sSimApplicationState[phoneId] == TelephonyManager.SIM_STATE_UNKNOWN))) {
            sSimApplicationState[phoneId] = state;
            Intent i = new Intent(TelephonyManager.ACTION_SIM_APPLICATION_STATE_CHANGED);
            i.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
            i.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
            i.putExtra(TelephonyManager.EXTRA_SIM_STATE, state);
            SubscriptionManager.putPhoneIdAndSubIdExtra(i, phoneId);
+2 −0
Original line number Diff line number Diff line
@@ -568,6 +568,8 @@ public class UiccController extends Handler {

        // broadcast slot status changed
        Intent intent = new Intent(TelephonyManager.ACTION_SIM_SLOT_STATUS_CHANGED);
        intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
        intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
        mContext.sendBroadcast(intent, android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE);
    }