From 0ced792cd69ff4e78b3ea84e6b38c1f1fddce82e Mon Sep 17 00:00:00 2001 From: Shishir Agrawal Date: Wed, 10 Dec 2014 10:20:39 -0800 Subject: 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 --- telephony/java/android/telephony/SubscriptionManager.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'telephony/java/android') diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index aca94e9..88ca8a4 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -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; + } } -- cgit v1.1