diff options
| author | Shishir Agrawal <shishir@google.com> | 2014-12-10 10:20:39 -0800 |
|---|---|---|
| committer | Cheuksan Wang <edwang@google.com> | 2015-03-30 14:11:07 -0700 |
| commit | 0ced792cd69ff4e78b3ea84e6b38c1f1fddce82e (patch) | |
| tree | 027d8312ab9711621d24cc68f9ef7c4631281e5c /telephony/java/android | |
| parent | cf9f5a16fb9daae3a18546d601da008df1cc63c6 (diff) | |
| download | frameworks_base-0ced792cd69ff4e78b3ea84e6b38c1f1fddce82e.zip frameworks_base-0ced792cd69ff4e78b3ea84e6b38c1f1fddce82e.tar.gz frameworks_base-0ced792cd69ff4e78b3ea84e6b38c1f1fddce82e.tar.bz2 | |
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
Diffstat (limited to 'telephony/java/android')
| -rw-r--r-- | telephony/java/android/telephony/SubscriptionManager.java | 14 |
1 files changed, 14 insertions, 0 deletions
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; + } } |
