diff options
| author | 2018-11-29 18:33:17 -0800 | |
|---|---|---|
| committer | 2018-12-14 10:53:03 -0800 | |
| commit | 70bb7c0396f1a7e26001bc86fd2e637ce2471ddc (patch) | |
| tree | fe31732c7f2f3b39fc4c7b9aea0d1d6b8dca6111 | |
| parent | 96dc16389442c52c88739ab03f2bbd81b807f666 (diff) | |
Add multiple esim support for SubscriptionManager
Bug: 112902036
Test: atest FrameworksTelephonyTests
Change-Id: Iea25c78e4f9c0b1e16add5f796b293e7ace08c67
| -rw-r--r-- | api/system-current.txt | 1 | ||||
| -rw-r--r-- | telephony/java/android/telephony/SubscriptionManager.java | 40 | ||||
| -rwxr-xr-x | telephony/java/com/android/internal/telephony/ISub.aidl | 2 |
3 files changed, 39 insertions, 4 deletions
diff --git a/api/system-current.txt b/api/system-current.txt index da6840c88a25..34902b5eaec5 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -5822,6 +5822,7 @@ package android.telephony { public class SubscriptionManager { method public java.util.List<android.telephony.SubscriptionInfo> getAvailableSubscriptionInfoList(); method public void requestEmbeddedSubscriptionInfoListRefresh(); + method public void requestEmbeddedSubscriptionInfoListRefresh(int); method public void setDefaultDataSubId(int); method public void setDefaultSmsSubId(int); field public static final android.net.Uri ADVANCED_CALLING_ENABLED_CONTENT_URI; diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index 387453fa3985..932dd1387d5c 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -1191,7 +1191,8 @@ public class SubscriptionManager { } /** - * Request a refresh of the platform cache of profile information. + * Request a refresh of the platform cache of profile information for the eUICC which + * corresponds to the card ID returned by {@link TelephonyManager#getCardIdForDefaultEuicc()}. * * <p>Should be called by the EuiccService implementation whenever this information changes due * to an operation done outside the scope of a request initiated by the platform to the @@ -1199,17 +1200,50 @@ public class SubscriptionManager { * were made through the EuiccService. * * <p>Requires the {@link android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS} permission. + * + * @see {@link TelephonyManager#getCardIdForDefaultEuicc()} for more information on the card ID. + * * @hide */ @SystemApi public void requestEmbeddedSubscriptionInfoListRefresh() { + int cardId = TelephonyManager.from(mContext).getCardIdForDefaultEuicc(); try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); if (iSub != null) { - iSub.requestEmbeddedSubscriptionInfoListRefresh(); + iSub.requestEmbeddedSubscriptionInfoListRefresh(cardId); } } catch (RemoteException ex) { - // ignore it + logd("requestEmbeddedSubscriptionInfoListFresh for card = " + cardId + " failed."); + } + } + + /** + * Request a refresh of the platform cache of profile information for the eUICC with the given + * {@code cardId}. + * + * <p>Should be called by the EuiccService implementation whenever this information changes due + * to an operation done outside the scope of a request initiated by the platform to the + * EuiccService. There is no need to refresh for downloads, deletes, or other operations that + * were made through the EuiccService. + * + * <p>Requires the {@link android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS} permission. + * + * @param cardId the card ID of the eUICC. + * + * @see {@link TelephonyManager#getCardIdForDefaultEuicc()} for more information on the card ID. + * + * @hide + */ + @SystemApi + public void requestEmbeddedSubscriptionInfoListRefresh(int cardId) { + try { + ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); + if (iSub != null) { + iSub.requestEmbeddedSubscriptionInfoListRefresh(cardId); + } + } catch (RemoteException ex) { + logd("requestEmbeddedSubscriptionInfoListFresh for card = " + cardId + " failed."); } } diff --git a/telephony/java/com/android/internal/telephony/ISub.aidl b/telephony/java/com/android/internal/telephony/ISub.aidl index 65d1a920a324..88c72197fb25 100755 --- a/telephony/java/com/android/internal/telephony/ISub.aidl +++ b/telephony/java/com/android/internal/telephony/ISub.aidl @@ -104,7 +104,7 @@ interface ISub { /** * @see android.telephony.SubscriptionManager#requestEmbeddedSubscriptionInfoListRefresh */ - oneway void requestEmbeddedSubscriptionInfoListRefresh(); + oneway void requestEmbeddedSubscriptionInfoListRefresh(int cardId); /** * Add a new SubscriptionInfo to subinfo database if needed |