Merge "using the correct intent extra for subId" am: 45db25d742

am: 1ae9d0bced

Change-Id: I4cf3ea508f0f06ecbf41216e5ea142b5fc1b5007
This commit is contained in:
Chen Xu
2018-10-01 21:51:38 -07:00
committed by android-build-merger
2 changed files with 6 additions and 0 deletions

View File

@@ -1644,6 +1644,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
intent.putExtras(data); intent.putExtras(data);
// Pass the subscription along with the intent. // Pass the subscription along with the intent.
intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId); intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId);
intent.putExtra(SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX, subId);
intent.putExtra(PhoneConstants.SLOT_KEY, phoneId); intent.putExtra(PhoneConstants.SLOT_KEY, phoneId);
mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL); mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL);
} }
@@ -1698,6 +1699,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
if (subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID) { if (subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
intent.setAction(PhoneConstants.ACTION_SUBSCRIPTION_PHONE_STATE_CHANGED); intent.setAction(PhoneConstants.ACTION_SUBSCRIPTION_PHONE_STATE_CHANGED);
intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId); intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId);
intent.putExtra(SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX, subId);
} }
// If the phoneId is invalid, the broadcast is for overall call state. // If the phoneId is invalid, the broadcast is for overall call state.
if (phoneId != SubscriptionManager.INVALID_PHONE_INDEX) { if (phoneId != SubscriptionManager.INVALID_PHONE_INDEX) {

View File

@@ -176,6 +176,10 @@ public class PhoneConstants {
// FIXME: This is used to pass a subId via intents, we need to look at its usage, which is // FIXME: This is used to pass a subId via intents, we need to look at its usage, which is
// FIXME: extensive, and see if this should be an array of all active subId's or ...? // FIXME: extensive, and see if this should be an array of all active subId's or ...?
/**
* @Deprecated use {@link android.telephony.SubscriptionManager#EXTRA_SUBSCRIPTION_INDEX}
* instead.
*/
public static final String SUBSCRIPTION_KEY = "subscription"; public static final String SUBSCRIPTION_KEY = "subscription";
public static final String SUB_SETTING = "subSettings"; public static final String SUB_SETTING = "subSettings";