Do not populate SLOT_KEY with wrong slot info

The slotId is not necessarily the phoneId, so do not broadcast as if it
is. SLOT_KEY is a hidden extra so this should not impact apps in general
(if they need the old extra they can still use the hidden PHONE_KEY).

For select broadcasts like SIM_CARD_STATE_CHANGED, we will manually
populate the slot key. This is a temporary solution to b/130664115 and
we should eventually review and consider making the SLOT_KEY public for
some broadcasts.

Bug: 130664115
Test: manual
Change-Id: I84bd4c6bc4277e32cee9916dd18dd80948a808a0
(cherry picked from commit 21c3aeb49d)
This commit is contained in:
Jordan Liu
2019-04-22 13:58:02 -07:00
parent fa7a24ef8e
commit 656f6f8b66

View File

@@ -2064,7 +2064,6 @@ public class SubscriptionManager {
} else {
logd("putPhoneIdAndSubIdExtra: no valid subs");
intent.putExtra(PhoneConstants.PHONE_KEY, phoneId);
intent.putExtra(PhoneConstants.SLOT_KEY, phoneId);
}
}
@@ -2075,9 +2074,6 @@ public class SubscriptionManager {
intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId);
intent.putExtra(EXTRA_SUBSCRIPTION_INDEX, subId);
intent.putExtra(PhoneConstants.PHONE_KEY, phoneId);
//FIXME this is using phoneId and slotIndex interchangeably
//Eventually, this should be removed as it is not the slot id
intent.putExtra(PhoneConstants.SLOT_KEY, phoneId);
}
/**