diff options
| author | Peter Wang <tpwang@google.com> | 2019-09-09 13:57:41 -0700 |
|---|---|---|
| committer | Peter Wang <tpwang@google.com> | 2019-10-07 17:25:18 -0700 |
| commit | 0c1297b2d7a2d8e21068a4b28056e396de8d7f64 (patch) | |
| tree | 261595745ef1786e2210d85834df463c5db0f32b /core/java/android | |
| parent | 2ee7cf7386d337e4f9cbe6001f22f47c84634a7d (diff) | |
Add EuiccCardManager.ResetOption to eraseSubscriptions
Bug: 139474431
Test: on device
Change-Id: Ib8496ed6dbc6179940892de8df7901e84dd67d76
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/service/euicc/EuiccService.java | 42 | ||||
| -rw-r--r-- | core/java/android/service/euicc/IEuiccService.aidl | 2 |
2 files changed, 43 insertions, 1 deletions
diff --git a/core/java/android/service/euicc/EuiccService.java b/core/java/android/service/euicc/EuiccService.java index ff8b13506201..8a9f68942e9d 100644 --- a/core/java/android/service/euicc/EuiccService.java +++ b/core/java/android/service/euicc/EuiccService.java @@ -15,6 +15,8 @@ */ package android.service.euicc; +import static android.telephony.euicc.EuiccCardManager.ResetOption; + import android.annotation.CallSuper; import android.annotation.IntDef; import android.annotation.NonNull; @@ -503,7 +505,7 @@ public abstract class EuiccService extends Service { String nickname); /** - * Erase all of the subscriptions on the device. + * Erase all operational subscriptions on the device. * * <p>This is intended to be used for device resets. As such, the reset should be performed even * if an active SIM must be deactivated in order to access the eUICC. @@ -512,10 +514,31 @@ public abstract class EuiccService extends Service { * @return the result of the erase operation. May be one of the predefined {@code RESULT_} * constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}. * @see android.telephony.euicc.EuiccManager#eraseSubscriptions + * + * @deprecated From R, callers should specify a flag for specific set of subscriptions to erase + * and use @link{onEraseSubscriptionsWithOptions} instead */ + @Deprecated public abstract int onEraseSubscriptions(int slotId); /** + * Erase specific subscriptions on the device. + * + * <p>This is intended to be used for device resets. As such, the reset should be performed even + * if an active SIM must be deactivated in order to access the eUICC. + * + * @param slotIndex index of the SIM slot to use for the operation. + * @param options flag for specific group of subscriptions to erase + * @return the result of the erase operation. May be one of the predefined {@code RESULT_} + * constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}. + * @see android.telephony.euicc.EuiccManager#eraseSubscriptionsWithOptions + */ + public int onEraseSubscriptionsWithOptions(int slotIndex, @ResetOption int options) { + throw new UnsupportedOperationException( + "This method must be overridden to enable the ResetOption parameter"); + } + + /** * Ensure that subscriptions will be retained on the next factory reset. * * <p>Called directly before a factory reset. Assumes that a normal factory reset will lead to @@ -751,6 +774,23 @@ public abstract class EuiccService extends Service { } @Override + public void eraseSubscriptionsWithOptions( + int slotIndex, @ResetOption int options, IEraseSubscriptionsCallback callback) { + mExecutor.execute(new Runnable() { + @Override + public void run() { + int result = EuiccService.this.onEraseSubscriptionsWithOptions( + slotIndex, options); + try { + callback.onComplete(result); + } catch (RemoteException e) { + // Can't communicate with the phone process; ignore. + } + } + }); + } + + @Override public void retainSubscriptionsForFactoryReset(int slotId, IRetainSubscriptionsForFactoryResetCallback callback) { mExecutor.execute(new Runnable() { diff --git a/core/java/android/service/euicc/IEuiccService.aidl b/core/java/android/service/euicc/IEuiccService.aidl index c2cdf093706f..2acc47aae919 100644 --- a/core/java/android/service/euicc/IEuiccService.aidl +++ b/core/java/android/service/euicc/IEuiccService.aidl @@ -52,6 +52,8 @@ oneway interface IEuiccService { void updateSubscriptionNickname(int slotId, String iccid, String nickname, in IUpdateSubscriptionNicknameCallback callback); void eraseSubscriptions(int slotId, in IEraseSubscriptionsCallback callback); + void eraseSubscriptionsWithOptions( + int slotIndex, int options, in IEraseSubscriptionsCallback callback); void retainSubscriptionsForFactoryReset( int slotId, in IRetainSubscriptionsForFactoryResetCallback callback); }
\ No newline at end of file |
