add an extra for rebroadcast of sim_state_change
fionaxu [Thu, 8 Jun 2017 22:39:59 +0000 (15:39 -0700)]
Bug: 62459330
Test: Manaual Test
Change-Id: Ib28e61906cc818d833175e756be729011a03603e

src/java/com/android/internal/telephony/CarrierActionAgent.java
src/java/com/android/internal/telephony/SubscriptionInfoUpdater.java

index 6d2daf0..2b91720 100644 (file)
@@ -77,6 +77,10 @@ public class CarrierActionAgent extends Handler {
             final String action = intent.getAction();
             final String iccState = intent.getStringExtra(IccCardConstants.INTENT_KEY_ICC_STATE);
             if (TelephonyIntents.ACTION_SIM_STATE_CHANGED.equals(action)){
+                if (intent.getBooleanExtra(TelephonyIntents.EXTRA_REBROADCAST_ON_UNLOCK, false)) {
+                    // ignore rebroadcast since carrier apps are direct boot aware.
+                    return;
+                }
                 if (IccCardConstants.INTENT_VALUE_ICC_LOADED.equals(iccState) ||
                         IccCardConstants.INTENT_VALUE_ICC_ABSENT.equals(iccState)) {
                     sendEmptyMessage(CARRIER_ACTION_RESET);
index 73141af..631aadd 100644 (file)
@@ -176,6 +176,7 @@ public class SubscriptionInfoUpdater extends Handler {
                 while (iterator.hasNext()) {
                     Map.Entry pair = (Map.Entry) iterator.next();
                     Intent i = (Intent)pair.getValue();
+                    i.putExtra(TelephonyIntents.EXTRA_REBROADCAST_ON_UNLOCK, true);
                     iterator.remove();
                     logd("Broadcasting intent ACTION_SIM_STATE_CHANGED for mCardIndex: " +
                             pair.getKey());