Fail SmsManager requests if SubId is not active.

If subId is not active, expected subIds can be assigned to the messages being
processed due to SmsManager calls. The change will fail any SmsManager calls
if SubId is not active.

Bug: 18629526
Change-Id: I8da1b1e2c477f32dcbaff417fc4e14ba2a225414
This commit is contained in:
Shishir Agrawal
2014-12-10 10:20:39 -08:00
committed by Cheuksan Wang
parent cf9f5a16fb
commit 0ced792cd6
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);
}