Merge "Add @hide API to get the phone account handle for a subId."
This commit is contained in:
@@ -8949,6 +8949,27 @@ public class TelephonyManager {
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines the {@link PhoneAccountHandle} associated with a subscription Id.
|
||||||
|
*
|
||||||
|
* @param subscriptionId The subscription Id to check.
|
||||||
|
* @return The {@link PhoneAccountHandle} associated with a subscription Id, or {@code null} if
|
||||||
|
* there is no associated {@link PhoneAccountHandle}.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public @Nullable PhoneAccountHandle getPhoneAccountHandleForSubscriptionId(int subscriptionId) {
|
||||||
|
PhoneAccountHandle returnValue = null;
|
||||||
|
try {
|
||||||
|
ITelephony service = getITelephony();
|
||||||
|
if (service != null) {
|
||||||
|
returnValue = service.getPhoneAccountHandleForSubscriptionId(subscriptionId);
|
||||||
|
}
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnValue;
|
||||||
|
}
|
||||||
|
|
||||||
private int getSubIdForPhoneAccountHandle(PhoneAccountHandle phoneAccountHandle) {
|
private int getSubIdForPhoneAccountHandle(PhoneAccountHandle phoneAccountHandle) {
|
||||||
int retval = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
|
int retval = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1265,6 +1265,11 @@ interface ITelephony {
|
|||||||
*/
|
*/
|
||||||
int getSubIdForPhoneAccount(in PhoneAccount phoneAccount);
|
int getSubIdForPhoneAccount(in PhoneAccount phoneAccount);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the PhoneAccountHandle associated with a subscription ID.
|
||||||
|
*/
|
||||||
|
PhoneAccountHandle getPhoneAccountHandleForSubscriptionId(int subscriptionId);
|
||||||
|
|
||||||
void factoryReset(int subId);
|
void factoryReset(int subId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user