diff options
| author | 2019-12-16 14:01:50 -0800 | |
|---|---|---|
| committer | 2020-01-08 13:56:27 -0800 | |
| commit | 4ece3db113808ee479dfd1ef857c63de04576c22 (patch) | |
| tree | 7316d3d53e5b73150d42ae60826d33a18b2db0d3 | |
| parent | 443ba6fc8d1b16530809832a7747adf0bdda4686 (diff) | |
Expose setUiccApplicationsEnabled as @SystemApi for eSIM to call upon slot
mapping change.
Because currently we rely on eSIM module to do handle some slot mapping
change and single to dual SIM config change, eSIM needs to also make
sure uicc applications are enabled for certain scenarios. So we expose
the SubscriptionManager#setUiccApplicationsEnabled as @SystemApi
Bug: 141018421
Test: unittest
Change-Id: I9844e71260ea009afd0928a0f4be4426e7d12358
Merged-In: I9844e71260ea009afd0928a0f4be4426e7d12358
| -rwxr-xr-x | api/system-current.txt | 1 | ||||
| -rw-r--r-- | telephony/java/android/telephony/SubscriptionManager.java | 28 | ||||
| -rwxr-xr-x | telephony/java/com/android/internal/telephony/ISub.aidl | 2 |
3 files changed, 31 insertions, 0 deletions
diff --git a/api/system-current.txt b/api/system-current.txt index a39394dae45e..038ed605cf06 100755 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -8927,6 +8927,7 @@ package android.telephony { method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDefaultVoiceSubscriptionId(int); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setPreferredDataSubscriptionId(int, boolean, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setSubscriptionEnabled(int, boolean); + method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUiccApplicationsEnabled(boolean, int); field @RequiresPermission(android.Manifest.permission.MANAGE_SUBSCRIPTION_PLANS) public static final String ACTION_SUBSCRIPTION_PLANS_CHANGED = "android.telephony.action.SUBSCRIPTION_PLANS_CHANGED"; field @NonNull public static final android.net.Uri ADVANCED_CALLING_ENABLED_CONTENT_URI; field public static final int PROFILE_CLASS_DEFAULT = -1; // 0xffffffff diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index 2ee0be19e36c..15c1807cd532 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -3167,6 +3167,34 @@ public class SubscriptionManager { } /** + * Set uicc applications being enabled or disabled. + * The value will be remembered on the subscription and will be applied whenever it's present. + * If the subscription in currently present, it will also apply the setting to modem + * immediately. + * + * Permissions android.Manifest.permission.MODIFY_PHONE_STATE is required + * + * @param enabled whether uicc applications are enabled or disabled. + * @param subscriptionId which subscription to operate on. + * @hide + */ + @SystemApi + @RequiresPermission(Manifest.permission.MODIFY_PHONE_STATE) + public void setUiccApplicationsEnabled(boolean enabled, int subscriptionId) { + if (VDBG) { + logd("setUiccApplicationsEnabled subId= " + subscriptionId + " enable " + enabled); + } + try { + ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); + if (iSub != null) { + iSub.setUiccApplicationsEnabled(enabled, subscriptionId); + } + } catch (RemoteException ex) { + // ignore it + } + } + + /** * Whether it's supported to disable / re-enable a subscription on a physical (non-euicc) SIM. * * Physical SIM refers non-euicc, or aka non-programmable SIM. diff --git a/telephony/java/com/android/internal/telephony/ISub.aidl b/telephony/java/com/android/internal/telephony/ISub.aidl index 92aab4b12330..5a26232c8892 100755 --- a/telephony/java/com/android/internal/telephony/ISub.aidl +++ b/telephony/java/com/android/internal/telephony/ISub.aidl @@ -285,4 +285,6 @@ interface ISub { int getActiveDataSubscriptionId(); boolean canDisablePhysicalSubscription(); + + int setUiccApplicationsEnabled(boolean enabled, int subscriptionId); } |