Merge "Cleaned up the deprecated APIs" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
eabe0a59f0
@@ -104,7 +104,7 @@ public class CellBroadcastIntents {
|
|||||||
* Put the phone ID and sub ID into an intent as extras.
|
* Put the phone ID and sub ID into an intent as extras.
|
||||||
*/
|
*/
|
||||||
private static void putPhoneIdAndSubIdExtra(Context context, Intent intent, int phoneId) {
|
private static void putPhoneIdAndSubIdExtra(Context context, Intent intent, int phoneId) {
|
||||||
int subId = getSubIdForPhone(context, phoneId);
|
int subId = SubscriptionManager.getSubscriptionId(phoneId);
|
||||||
if (subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
|
if (subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
|
||||||
intent.putExtra("subscription", subId);
|
intent.putExtra("subscription", subId);
|
||||||
intent.putExtra(SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX, subId);
|
intent.putExtra(SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX, subId);
|
||||||
@@ -112,22 +112,4 @@ public class CellBroadcastIntents {
|
|||||||
intent.putExtra("phone", phoneId);
|
intent.putExtra("phone", phoneId);
|
||||||
intent.putExtra(SubscriptionManager.EXTRA_SLOT_INDEX, phoneId);
|
intent.putExtra(SubscriptionManager.EXTRA_SLOT_INDEX, phoneId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the subscription ID for a phone ID, or INVALID_SUBSCRIPTION_ID if the phone does not
|
|
||||||
* have an active sub
|
|
||||||
* @param phoneId the phoneId to use
|
|
||||||
* @return the associated sub id
|
|
||||||
*/
|
|
||||||
private static int getSubIdForPhone(Context context, int phoneId) {
|
|
||||||
SubscriptionManager subMan =
|
|
||||||
(SubscriptionManager) context.getSystemService(
|
|
||||||
Context.TELEPHONY_SUBSCRIPTION_SERVICE);
|
|
||||||
int[] subIds = subMan.getSubscriptionIds(phoneId);
|
|
||||||
if (subIds != null) {
|
|
||||||
return subIds[0];
|
|
||||||
} else {
|
|
||||||
return SubscriptionManager.INVALID_SUBSCRIPTION_ID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -342,8 +342,8 @@ public abstract class ImsFeature {
|
|||||||
/**
|
/**
|
||||||
* @return The SIM slot index associated with this ImsFeature.
|
* @return The SIM slot index associated with this ImsFeature.
|
||||||
*
|
*
|
||||||
* @see SubscriptionManager#getSubscriptionIds(int) for more information on getting the
|
* @see SubscriptionManager#getSubscriptionId(int) for more information on getting the
|
||||||
* subscription IDs associated with this slot.
|
* subscription ID associated with this slot.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
@SystemApi
|
||||||
|
|||||||
Reference in New Issue
Block a user