Merge "Fail SmsManager requests if SubId is not active." into m-wireless-dev

This commit is contained in:
Cheuksan Wang
2015-04-24 21:39:01 +00:00
committed by Android Partner Code Review
2 changed files with 15 additions and 0 deletions

View File

@@ -1133,5 +1133,19 @@ public class SubscriptionManager {
logd("getSimStateForSubscriber: simState=" + simState + " subId=" + subId);
return simState;
}
/**
* @return true if the sub ID is active. i.e. The sub ID corresponds to a known subscription
* and the SIM providing the subscription is present in a slot and in "LOADED" state.
* @hide
*/
public boolean isActiveSubId(int subId) {
try {
ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
return iSub.isActiveSubId(subId);
} catch (RemoteException ex) {
}
return false;
}
}

View File

@@ -171,4 +171,5 @@ interface ISub {
*/
int getSimStateForSubscriber(int subId);
boolean isActiveSubId(int subId);
}