blob: bc6a9e848e2af944d069e1746eeb962e9421d2d1 [file] [log] [blame]
Jeff Davidson35cda392017-02-27 09:46:00 -08001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package android.service.euicc;
17
Peter Wang2ab852d2019-09-09 13:57:41 -070018import static android.telephony.euicc.EuiccCardManager.ResetOption;
19
Jeff Davidson35cda392017-02-27 09:46:00 -080020import android.annotation.CallSuper;
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -070021import android.annotation.IntDef;
22import android.annotation.NonNull;
Jeff Davidson91c3d072017-04-12 12:17:11 -070023import android.annotation.Nullable;
Jiashen Wang216ae8d2019-10-18 11:00:11 -070024import android.annotation.SdkConstant;
Holly Jiuyu Sun4f73b9c2017-12-12 20:17:09 -080025import android.annotation.SystemApi;
Jeff Davidson35cda392017-02-27 09:46:00 -080026import android.app.Service;
27import android.content.Intent;
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -070028import android.os.Bundle;
Jeff Davidson35cda392017-02-27 09:46:00 -080029import android.os.IBinder;
30import android.os.RemoteException;
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -070031import android.telephony.TelephonyManager;
Jeff Davidson35cda392017-02-27 09:46:00 -080032import android.telephony.euicc.DownloadableSubscription;
Jeff Davidson91c3d072017-04-12 12:17:11 -070033import android.telephony.euicc.EuiccInfo;
Qingxi Li54058362017-12-13 15:13:02 -080034import android.telephony.euicc.EuiccManager.OtaStatus;
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -070035import android.util.Log;
Jeff Davidson35cda392017-02-27 09:46:00 -080036
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -070037import java.lang.annotation.Retention;
38import java.lang.annotation.RetentionPolicy;
Jeff Davidson707c3722017-06-12 11:40:52 -070039import java.util.concurrent.LinkedBlockingQueue;
40import java.util.concurrent.ThreadFactory;
41import java.util.concurrent.ThreadPoolExecutor;
42import java.util.concurrent.TimeUnit;
43import java.util.concurrent.atomic.AtomicInteger;
44
Jeff Davidson35cda392017-02-27 09:46:00 -080045/**
46 * Service interface linking the system with an eUICC local profile assistant (LPA) application.
47 *
48 * <p>An LPA consists of two separate components (which may both be implemented in the same APK):
49 * the LPA backend, and the LPA UI or LUI.
50 *
51 * <p>To implement the LPA backend, you must extend this class and declare this service in your
52 * manifest file. The service must require the
53 * {@link android.Manifest.permission#BIND_EUICC_SERVICE} permission and include an intent filter
Holly Jiuyu Sun4f73b9c2017-12-12 20:17:09 -080054 * with the {@link #EUICC_SERVICE_INTERFACE} action. It's suggested that the priority of the intent
55 * filter to be set to a non-zero value in case multiple implementations are present on the device.
56 * See the below example. Note that there will be problem if two LPAs are present and they have the
57 * same priority.
58 * Example:
Jeff Davidson35cda392017-02-27 09:46:00 -080059 *
60 * <pre>{@code
61 * <service android:name=".MyEuiccService"
62 * android:permission="android.permission.BIND_EUICC_SERVICE">
63 * <intent-filter android:priority="100">
64 * <action android:name="android.service.euicc.EuiccService" />
65 * </intent-filter>
66 * </service>
67 * }</pre>
68 *
69 * <p>To implement the LUI, you must provide an activity for the following actions:
70 *
71 * <ul>
72 * <li>{@link #ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS}
73 * <li>{@link #ACTION_PROVISION_EMBEDDED_SUBSCRIPTION}
74 * </ul>
75 *
76 * <p>As with the service, each activity must require the
77 * {@link android.Manifest.permission#BIND_EUICC_SERVICE} permission. Each should have an intent
78 * filter with the appropriate action, the {@link #CATEGORY_EUICC_UI} category, and a non-zero
79 * priority.
80 *
Jordan Liucb47d1d2019-02-01 14:15:05 -080081 * <p>Old implementations of EuiccService may support passing in slot IDs equal to
82 * {@link android.telephony.SubscriptionManager#INVALID_SIM_SLOT_INDEX}, which allows the LPA to
83 * decide which eUICC to target when there are multiple eUICCs. This behavior is not supported in
84 * Android Q or later.
85 *
Jeff Davidson35cda392017-02-27 09:46:00 -080086 * @hide
87 */
Holly Jiuyu Sun4f73b9c2017-12-12 20:17:09 -080088@SystemApi
Jeff Davidson35cda392017-02-27 09:46:00 -080089public abstract class EuiccService extends Service {
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -070090 private static final String TAG = "EuiccService";
91
Jeff Davidson35cda392017-02-27 09:46:00 -080092 /** Action which must be included in this service's intent filter. */
93 public static final String EUICC_SERVICE_INTERFACE = "android.service.euicc.EuiccService";
94
95 /** Category which must be defined to all UI actions, for efficient lookup. */
96 public static final String CATEGORY_EUICC_UI = "android.service.euicc.category.EUICC_UI";
97
98 // LUI actions. These are passthroughs of the corresponding EuiccManager actions.
99
Holly Jiuyu Sun4f73b9c2017-12-12 20:17:09 -0800100 /**
Qingxi Licfb6e7b2018-11-12 18:00:20 -0800101 * Action used to bind the carrier app and get the activation code from the carrier app. This
102 * activation code will be used to download the eSIM profile during eSIM activation flow.
103 */
104 public static final String ACTION_BIND_CARRIER_PROVISIONING_SERVICE =
105 "android.service.euicc.action.BIND_CARRIER_PROVISIONING_SERVICE";
106
107 /**
Jiashen Wang216ae8d2019-10-18 11:00:11 -0700108 * Intent action sent by the LPA to launch a carrier app Activity for eSIM activation, e.g. a
109 * carrier login screen. Carrier apps wishing to support this activation method must implement
110 * an Activity that responds to this intent action. Upon completion, the Activity must return
111 * one of the following results to the LPA:
112 *
113 * <p>{@code Activity.RESULT_CANCELED}: The LPA should treat this as an back button and abort
114 * the activation flow.
115 * <p>{@code Activity.RESULT_OK}: The LPA should try to get an activation code from the carrier
116 * app by binding to the carrier app service implementing
117 * {@link #ACTION_BIND_CARRIER_PROVISIONING_SERVICE}.
118 * <p>{@code Activity.RESULT_OK} with
119 * {@link android.telephony.euicc.EuiccManager#EXTRA_USE_QR_SCANNER} set to true: The LPA should
120 * start a QR scanner for the user to scan an eSIM profile QR code.
121 * <p>For other results: The LPA should treat this as an error.
122 **/
123 @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
124 public static final String ACTION_START_CARRIER_ACTIVATION =
125 "android.service.euicc.action.START_CARRIER_ACTIVATION";
126
127 /**
Holly Jiuyu Sun4f73b9c2017-12-12 20:17:09 -0800128 * @see android.telephony.euicc.EuiccManager#ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS
129 * The difference is this one is used by system to bring up the LUI.
130 */
Jeff Davidson35cda392017-02-27 09:46:00 -0800131 public static final String ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS =
132 "android.service.euicc.action.MANAGE_EMBEDDED_SUBSCRIPTIONS";
Patrick Huangf43a0cc2019-01-14 17:47:56 -0800133
Jeff Davidson35cda392017-02-27 09:46:00 -0800134 /** @see android.telephony.euicc.EuiccManager#ACTION_PROVISION_EMBEDDED_SUBSCRIPTION */
135 public static final String ACTION_PROVISION_EMBEDDED_SUBSCRIPTION =
136 "android.service.euicc.action.PROVISION_EMBEDDED_SUBSCRIPTION";
137
Patrick Huang8002fe42019-03-14 19:25:47 -0700138 /**
139 * @see android.telephony.euicc.EuiccManager#ACTION_TOGGLE_SUBSCRIPTION_PRIVILEGED. This is
140 * a protected intent that can only be sent by the system, and requires the
141 * {@link android.Manifest.permission#BIND_EUICC_SERVICE} permission.
142 */
Patrick Huangf43a0cc2019-01-14 17:47:56 -0800143 public static final String ACTION_TOGGLE_SUBSCRIPTION_PRIVILEGED =
144 "android.service.euicc.action.TOGGLE_SUBSCRIPTION_PRIVILEGED";
145
Patrick Huang8002fe42019-03-14 19:25:47 -0700146 /**
147 * @see android.telephony.euicc.EuiccManager#ACTION_DELETE_SUBSCRIPTION_PRIVILEGED. This is
148 * a protected intent that can only be sent by the system, and requires the
149 * {@link android.Manifest.permission#BIND_EUICC_SERVICE} permission.
150 */
Patrick Huangf43a0cc2019-01-14 17:47:56 -0800151 public static final String ACTION_DELETE_SUBSCRIPTION_PRIVILEGED =
152 "android.service.euicc.action.DELETE_SUBSCRIPTION_PRIVILEGED";
153
Patrick Huang8002fe42019-03-14 19:25:47 -0700154 /**
155 * @see android.telephony.euicc.EuiccManager#ACTION_RENAME_SUBSCRIPTION_PRIVILEGED. This is
156 * a protected intent that can only be sent by the system, and requires the
157 * {@link android.Manifest.permission#BIND_EUICC_SERVICE} permission.
158 */
Patrick Huangf43a0cc2019-01-14 17:47:56 -0800159 public static final String ACTION_RENAME_SUBSCRIPTION_PRIVILEGED =
160 "android.service.euicc.action.RENAME_SUBSCRIPTION_PRIVILEGED";
161
Jiashen Wang216ae8d2019-10-18 11:00:11 -0700162 /**
163 * @see android.telephony.euicc.EuiccManager#ACTION_START_EUICC_ACTIVATION. This is
164 * a protected intent that can only be sent by the system, and requires the
165 * {@link android.Manifest.permission#BIND_EUICC_SERVICE} permission.
166 */
167 @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
168 public static final String ACTION_START_EUICC_ACTIVATION =
169 "android.service.euicc.action.START_EUICC_ACTIVATION";
170
Jeff Davidsoncfa70fa2017-04-06 16:02:36 -0700171 // LUI resolution actions. These are called by the platform to resolve errors in situations that
172 // require user interaction.
173 // TODO(b/33075886): Define extras for any input parameters to these dialogs once they are
174 // more scoped out.
Holly Jiuyu Sun4f73b9c2017-12-12 20:17:09 -0800175 /**
176 * Alert the user that this action will result in an active SIM being deactivated.
177 * To implement the LUI triggered by the system, you need to define this in AndroidManifest.xml.
178 */
Jeff Davidsoncfa70fa2017-04-06 16:02:36 -0700179 public static final String ACTION_RESOLVE_DEACTIVATE_SIM =
180 "android.service.euicc.action.RESOLVE_DEACTIVATE_SIM";
181 /**
182 * Alert the user about a download/switch being done for an app that doesn't currently have
183 * carrier privileges.
184 */
185 public static final String ACTION_RESOLVE_NO_PRIVILEGES =
186 "android.service.euicc.action.RESOLVE_NO_PRIVILEGES";
Jeff Davidson83f8bc82017-05-15 10:22:20 -0700187
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700188 /**
189 * Ask the user to input carrier confirmation code.
190 *
191 * @deprecated From Q, the resolvable errors happened in the download step are presented as
192 * bit map in {@link #EXTRA_RESOLVABLE_ERRORS}. The corresponding action would be
193 * {@link #ACTION_RESOLVE_RESOLVABLE_ERRORS}.
194 */
195 @Deprecated
Holly Jiuyu Sun6a2877e2017-10-13 19:06:34 -0700196 public static final String ACTION_RESOLVE_CONFIRMATION_CODE =
197 "android.service.euicc.action.RESOLVE_CONFIRMATION_CODE";
198
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700199 /** Ask the user to resolve all the resolvable errors. */
200 public static final String ACTION_RESOLVE_RESOLVABLE_ERRORS =
201 "android.service.euicc.action.RESOLVE_RESOLVABLE_ERRORS";
202
203 /** @hide */
204 @Retention(RetentionPolicy.SOURCE)
205 @IntDef(flag = true, prefix = { "RESOLVABLE_ERROR_" }, value = {
206 RESOLVABLE_ERROR_CONFIRMATION_CODE,
207 RESOLVABLE_ERROR_POLICY_RULES,
208 })
209 public @interface ResolvableError {}
210
211 /**
212 * Possible value for the bit map of resolvable errors indicating the download process needs
213 * the user to input confirmation code.
214 */
215 public static final int RESOLVABLE_ERROR_CONFIRMATION_CODE = 1 << 0;
216 /**
217 * Possible value for the bit map of resolvable errors indicating the download process needs
218 * the user's consent to allow profile policy rules.
219 */
220 public static final int RESOLVABLE_ERROR_POLICY_RULES = 1 << 1;
221
Holly Jiuyu Sun4f73b9c2017-12-12 20:17:09 -0800222 /**
223 * Intent extra set for resolution requests containing the package name of the calling app.
224 * This is used by the above actions including ACTION_RESOLVE_DEACTIVATE_SIM,
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700225 * ACTION_RESOLVE_NO_PRIVILEGES and ACTION_RESOLVE_RESOLVABLE_ERRORS.
Holly Jiuyu Sun4f73b9c2017-12-12 20:17:09 -0800226 */
Jeff Davidsonb4c67ec2017-06-13 15:28:57 -0700227 public static final String EXTRA_RESOLUTION_CALLING_PACKAGE =
228 "android.service.euicc.extra.RESOLUTION_CALLING_PACKAGE";
229
Holly Jiuyu Sun26008be2017-11-09 19:28:49 -0800230 /**
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700231 * Intent extra set for resolution requests containing the list of resolvable errors to be
232 * resolved. Each resolvable error is an integer. Its possible values include:
233 * <UL>
234 * <LI>{@link #RESOLVABLE_ERROR_CONFIRMATION_CODE}
235 * <LI>{@link #RESOLVABLE_ERROR_POLICY_RULES}
236 * </UL>
237 */
238 public static final String EXTRA_RESOLVABLE_ERRORS =
239 "android.service.euicc.extra.RESOLVABLE_ERRORS";
240
241 /**
Holly Jiuyu Sun26008be2017-11-09 19:28:49 -0800242 * Intent extra set for resolution requests containing a boolean indicating whether to ask the
243 * user to retry another confirmation code.
244 */
245 public static final String EXTRA_RESOLUTION_CONFIRMATION_CODE_RETRIED =
246 "android.service.euicc.extra.RESOLUTION_CONFIRMATION_CODE_RETRIED";
247
Holly Jiuyu Sunda56f082019-01-17 17:09:09 -0800248 /**
249 * Intent extra set for resolution requests containing an int indicating the current card Id.
250 */
251 public static final String EXTRA_RESOLUTION_CARD_ID =
252 "android.service.euicc.extra.RESOLUTION_CARD_ID";
253
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700254 /** @hide */
255 @Retention(RetentionPolicy.SOURCE)
256 @IntDef(prefix = { "RESULT_" }, value = {
257 RESULT_OK,
258 RESULT_MUST_DEACTIVATE_SIM,
259 RESULT_RESOLVABLE_ERRORS,
260 RESULT_NEED_CONFIRMATION_CODE,
261 RESULT_FIRST_USER,
262 })
263 public @interface Result {}
264
Jeff Davidson83f8bc82017-05-15 10:22:20 -0700265 /** Result code for a successful operation. */
266 public static final int RESULT_OK = 0;
267 /** Result code indicating that an active SIM must be deactivated to perform the operation. */
268 public static final int RESULT_MUST_DEACTIVATE_SIM = -1;
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700269 /** Result code indicating that the user must resolve resolvable errors. */
270 public static final int RESULT_RESOLVABLE_ERRORS = -2;
271 /**
272 * Result code indicating that the user must input a carrier confirmation code.
273 *
274 * @deprecated From Q, the resolvable errors happened in the download step are presented as
275 * bit map in {@link #EXTRA_RESOLVABLE_ERRORS}. The corresponding result would be
276 * {@link #RESULT_RESOLVABLE_ERRORS}.
277 */
278 @Deprecated
Holly Jiuyu Sun6a2877e2017-10-13 19:06:34 -0700279 public static final int RESULT_NEED_CONFIRMATION_CODE = -2;
Jeff Davidson83f8bc82017-05-15 10:22:20 -0700280 // New predefined codes should have negative values.
281
282 /** Start of implementation-specific error results. */
283 public static final int RESULT_FIRST_USER = 1;
284
Jeff Davidsoncfa70fa2017-04-06 16:02:36 -0700285 /**
Holly Jiuyu Sun4f73b9c2017-12-12 20:17:09 -0800286 * Boolean extra for resolution actions indicating whether the user granted consent.
287 * This is used and set by the implementation and used in {@code EuiccOperation}.
288 */
289 public static final String EXTRA_RESOLUTION_CONSENT =
290 "android.service.euicc.extra.RESOLUTION_CONSENT";
291 /**
292 * String extra for resolution actions indicating the carrier confirmation code.
293 * This is used and set by the implementation and used in {@code EuiccOperation}.
294 */
295 public static final String EXTRA_RESOLUTION_CONFIRMATION_CODE =
296 "android.service.euicc.extra.RESOLUTION_CONFIRMATION_CODE";
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700297 /**
298 * String extra for resolution actions indicating whether the user allows policy rules.
299 * This is used and set by the implementation and used in {@code EuiccOperation}.
300 */
301 public static final String EXTRA_RESOLUTION_ALLOW_POLICY_RULES =
302 "android.service.euicc.extra.RESOLUTION_ALLOW_POLICY_RULES";
Jeff Davidsoncfa70fa2017-04-06 16:02:36 -0700303
Jeff Davidson35cda392017-02-27 09:46:00 -0800304 private final IEuiccService.Stub mStubWrapper;
305
Jeff Davidson707c3722017-06-12 11:40:52 -0700306 private ThreadPoolExecutor mExecutor;
307
Jeff Davidson35cda392017-02-27 09:46:00 -0800308 public EuiccService() {
309 mStubWrapper = new IEuiccServiceWrapper();
310 }
311
Jeff Davidson707c3722017-06-12 11:40:52 -0700312 @Override
313 @CallSuper
314 public void onCreate() {
315 super.onCreate();
316 // We use a oneway AIDL interface to avoid blocking phone process binder threads on IPCs to
317 // an external process, but doing so means the requests are serialized by binder, which is
318 // not desired. Spin up a background thread pool to allow requests to be parallelized.
319 // TODO(b/38206971): Consider removing this if basic card-level functions like listing
320 // profiles are moved to the platform.
321 mExecutor = new ThreadPoolExecutor(
322 4 /* corePoolSize */,
323 4 /* maxPoolSize */,
324 30, TimeUnit.SECONDS, /* keepAliveTime */
325 new LinkedBlockingQueue<>(), /* workQueue */
326 new ThreadFactory() {
327 private final AtomicInteger mCount = new AtomicInteger(1);
328
329 @Override
330 public Thread newThread(Runnable r) {
331 return new Thread(r, "EuiccService #" + mCount.getAndIncrement());
332 }
333 }
334 );
335 mExecutor.allowCoreThreadTimeOut(true);
336 }
337
338 @Override
339 @CallSuper
340 public void onDestroy() {
341 mExecutor.shutdownNow();
342 super.onDestroy();
343 }
344
Jeff Davidson35cda392017-02-27 09:46:00 -0800345 /**
346 * If overriding this method, call through to the super method for any unknown actions.
347 * {@inheritDoc}
348 */
349 @Override
350 @CallSuper
351 public IBinder onBind(Intent intent) {
352 return mStubWrapper;
353 }
354
355 /**
Qingxi Li6019f9c2017-12-14 15:36:06 -0800356 * Callback class for {@link #onStartOtaIfNecessary(int, OtaStatusChangedCallback)}
357 *
358 * The status of OTA which can be {@code android.telephony.euicc.EuiccManager#EUICC_OTA_}
359 *
360 * @see IEuiccService#startOtaIfNecessary
361 */
Holly Jiuyu Sun4f73b9c2017-12-12 20:17:09 -0800362 public abstract static class OtaStatusChangedCallback {
Qingxi Li6019f9c2017-12-14 15:36:06 -0800363 /** Called when OTA status is changed. */
Holly Jiuyu Sun4f73b9c2017-12-12 20:17:09 -0800364 public abstract void onOtaStatusChanged(int status);
Qingxi Li6019f9c2017-12-14 15:36:06 -0800365 }
366
367 /**
Jeff Davidson35cda392017-02-27 09:46:00 -0800368 * Return the EID of the eUICC.
369 *
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700370 * @param slotId ID of the SIM slot being queried.
Jeff Davidson35cda392017-02-27 09:46:00 -0800371 * @return the EID.
372 * @see android.telephony.euicc.EuiccManager#getEid
373 */
374 // TODO(b/36260308): Update doc when we have multi-SIM support.
375 public abstract String onGetEid(int slotId);
376
377 /**
Qingxi Li54058362017-12-13 15:13:02 -0800378 * Return the status of OTA update.
379 *
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700380 * @param slotId ID of the SIM slot to use for the operation.
Qingxi Li54058362017-12-13 15:13:02 -0800381 * @return The status of Euicc OTA update.
382 * @see android.telephony.euicc.EuiccManager#getOtaStatus
383 */
384 public abstract @OtaStatus int onGetOtaStatus(int slotId);
385
386 /**
Qingxi Li6019f9c2017-12-14 15:36:06 -0800387 * Perform OTA if current OS is not the latest one.
388 *
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700389 * @param slotId ID of the SIM slot to use for the operation.
Qingxi Li6019f9c2017-12-14 15:36:06 -0800390 * @param statusChangedCallback Function called when OTA status changed.
391 */
392 public abstract void onStartOtaIfNecessary(
393 int slotId, OtaStatusChangedCallback statusChangedCallback);
394
395 /**
Jeff Davidson35cda392017-02-27 09:46:00 -0800396 * Populate {@link DownloadableSubscription} metadata for the given downloadable subscription.
397 *
Holly Jiuyu Sun4f73b9c2017-12-12 20:17:09 -0800398 * @param slotId ID of the SIM slot to use for the operation.
Jeff Davidson35cda392017-02-27 09:46:00 -0800399 * @param subscription A subscription whose metadata needs to be populated.
Jeff Davidsoncfa70fa2017-04-06 16:02:36 -0700400 * @param forceDeactivateSim If true, and if an active SIM must be deactivated to access the
Jeff Davidson83f8bc82017-05-15 10:22:20 -0700401 * eUICC, perform this action automatically. Otherwise, {@link #RESULT_MUST_DEACTIVATE_SIM)}
402 * should be returned to allow the user to consent to this operation first.
Jeff Davidson35cda392017-02-27 09:46:00 -0800403 * @return The result of the operation.
404 * @see android.telephony.euicc.EuiccManager#getDownloadableSubscriptionMetadata
405 */
Jeff Davidson91c3d072017-04-12 12:17:11 -0700406 public abstract GetDownloadableSubscriptionMetadataResult onGetDownloadableSubscriptionMetadata(
Jeff Davidsoncfa70fa2017-04-06 16:02:36 -0700407 int slotId, DownloadableSubscription subscription, boolean forceDeactivateSim);
Jeff Davidson35cda392017-02-27 09:46:00 -0800408
409 /**
Jeff Davidson91c3d072017-04-12 12:17:11 -0700410 * Return metadata for subscriptions which are available for download for this device.
411 *
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700412 * @param slotId ID of the SIM slot to use for the operation.
Jeff Davidson91c3d072017-04-12 12:17:11 -0700413 * @param forceDeactivateSim If true, and if an active SIM must be deactivated to access the
Jeff Davidson83f8bc82017-05-15 10:22:20 -0700414 * eUICC, perform this action automatically. Otherwise, {@link #RESULT_MUST_DEACTIVATE_SIM)}
415 * should be returned to allow the user to consent to this operation first.
Jeff Davidson91c3d072017-04-12 12:17:11 -0700416 * @return The result of the list operation.
417 * @see android.telephony.euicc.EuiccManager#getDefaultDownloadableSubscriptionList
418 */
419 public abstract GetDefaultDownloadableSubscriptionListResult
420 onGetDefaultDownloadableSubscriptionList(int slotId, boolean forceDeactivateSim);
421
422 /**
Jeff Davidson35cda392017-02-27 09:46:00 -0800423 * Download the given subscription.
424 *
Holly Jiuyu Sun4f73b9c2017-12-12 20:17:09 -0800425 * @param slotId ID of the SIM slot to use for the operation.
Jeff Davidson35cda392017-02-27 09:46:00 -0800426 * @param subscription The subscription to download.
427 * @param switchAfterDownload If true, the subscription should be enabled upon successful
428 * download.
Jeff Davidsoncfa70fa2017-04-06 16:02:36 -0700429 * @param forceDeactivateSim If true, and if an active SIM must be deactivated to access the
Jeff Davidson83f8bc82017-05-15 10:22:20 -0700430 * eUICC, perform this action automatically. Otherwise, {@link #RESULT_MUST_DEACTIVATE_SIM}
431 * should be returned to allow the user to consent to this operation first.
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700432 * @param resolvedBundle The bundle containing information on resolved errors. It can contain
433 * a string of confirmation code for the key {@link #EXTRA_RESOLUTION_CONFIRMATION_CODE},
434 * and a boolean for key {@link #EXTRA_RESOLUTION_ALLOW_POLICY_RULES} indicating whether
435 * the user allows profile policy rules or not.
436 * @return a DownloadSubscriptionResult instance including a result code, a resolvable errors
437 * bit map, and original the card Id. The result code may be one of the predefined
438 * {@code RESULT_} constants or any implementation-specific code starting with
439 * {@link #RESULT_FIRST_USER}. The resolvable error bit map can be either 0 or values
Holly Jiuyu Sunc67c86c2019-04-10 14:34:07 -0700440 * defined in {@code RESOLVABLE_ERROR_}. A subclass should override this method. Otherwise,
441 * this method does nothing and returns null by default.
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700442 * @see android.telephony.euicc.EuiccManager#downloadSubscription
443 */
Holly Jiuyu Sunc67c86c2019-04-10 14:34:07 -0700444 public DownloadSubscriptionResult onDownloadSubscription(int slotId,
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700445 @NonNull DownloadableSubscription subscription, boolean switchAfterDownload,
Holly Jiuyu Sunc67c86c2019-04-10 14:34:07 -0700446 boolean forceDeactivateSim, @Nullable Bundle resolvedBundle) {
447 return null;
448 }
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700449
450 /**
451 * Download the given subscription.
452 *
453 * @param slotId ID of the SIM slot to use for the operation.
454 * @param subscription The subscription to download.
455 * @param switchAfterDownload If true, the subscription should be enabled upon successful
456 * download.
457 * @param forceDeactivateSim If true, and if an active SIM must be deactivated to access the
458 * eUICC, perform this action automatically. Otherwise, {@link #RESULT_MUST_DEACTIVATE_SIM}
459 * should be returned to allow the user to consent to this operation first.
Jeff Davidson83f8bc82017-05-15 10:22:20 -0700460 * @return the result of the download operation. May be one of the predefined {@code RESULT_}
461 * constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}.
Jeff Davidson35cda392017-02-27 09:46:00 -0800462 * @see android.telephony.euicc.EuiccManager#downloadSubscription
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700463 *
Holly Jiuyu Sunc67c86c2019-04-10 14:34:07 -0700464 * @deprecated From Q, a subclass should use and override the above
465 * {@link #onDownloadSubscription(int, DownloadableSubscription, boolean, boolean, Bundle)}. The
466 * default return value for this one is Integer.MIN_VALUE.
Jeff Davidson35cda392017-02-27 09:46:00 -0800467 */
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700468 @Deprecated public @Result int onDownloadSubscription(int slotId,
469 @NonNull DownloadableSubscription subscription, boolean switchAfterDownload,
470 boolean forceDeactivateSim) {
Holly Jiuyu Sunc67c86c2019-04-10 14:34:07 -0700471 return Integer.MIN_VALUE;
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700472 }
Jeff Davidson35cda392017-02-27 09:46:00 -0800473
474 /**
Jeff Davidsond02731f2017-04-09 14:31:09 -0700475 * Return a list of all @link EuiccProfileInfo}s.
476 *
Holly Jiuyu Sun4f73b9c2017-12-12 20:17:09 -0800477 * @param slotId ID of the SIM slot to use for the operation.
Jeff Davidsond02731f2017-04-09 14:31:09 -0700478 * @return The result of the operation.
479 * @see android.telephony.SubscriptionManager#getAvailableSubscriptionInfoList
480 * @see android.telephony.SubscriptionManager#getAccessibleSubscriptionInfoList
481 */
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700482 public abstract @NonNull GetEuiccProfileInfoListResult onGetEuiccProfileInfoList(int slotId);
Jeff Davidsond02731f2017-04-09 14:31:09 -0700483
484 /**
Jeff Davidson91c3d072017-04-12 12:17:11 -0700485 * Return info about the eUICC chip/device.
486 *
Holly Jiuyu Sun4f73b9c2017-12-12 20:17:09 -0800487 * @param slotId ID of the SIM slot to use for the operation.
Jeff Davidson91c3d072017-04-12 12:17:11 -0700488 * @return the {@link EuiccInfo} for the eUICC chip/device.
489 * @see android.telephony.euicc.EuiccManager#getEuiccInfo
490 */
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700491 public abstract @NonNull EuiccInfo onGetEuiccInfo(int slotId);
Jeff Davidson91c3d072017-04-12 12:17:11 -0700492
493 /**
494 * Delete the given subscription.
495 *
496 * <p>If the subscription is currently active, it should be deactivated first (equivalent to a
497 * physical SIM being ejected).
498 *
Holly Jiuyu Sun4f73b9c2017-12-12 20:17:09 -0800499 * @param slotId ID of the SIM slot to use for the operation.
Jeff Davidson91c3d072017-04-12 12:17:11 -0700500 * @param iccid the ICCID of the subscription to delete.
Jeff Davidson83f8bc82017-05-15 10:22:20 -0700501 * @return the result of the delete operation. May be one of the predefined {@code RESULT_}
502 * constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}.
Jeff Davidson91c3d072017-04-12 12:17:11 -0700503 * @see android.telephony.euicc.EuiccManager#deleteSubscription
504 */
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700505 public abstract @Result int onDeleteSubscription(int slotId, String iccid);
Jeff Davidson91c3d072017-04-12 12:17:11 -0700506
507 /**
508 * Switch to the given subscription.
509 *
Holly Jiuyu Sun4f73b9c2017-12-12 20:17:09 -0800510 * @param slotId ID of the SIM slot to use for the operation.
Jeff Davidson91c3d072017-04-12 12:17:11 -0700511 * @param iccid the ICCID of the subscription to enable. May be null, in which case the current
512 * profile should be deactivated and no profile should be activated to replace it - this is
513 * equivalent to a physical SIM being ejected.
514 * @param forceDeactivateSim If true, and if an active SIM must be deactivated to access the
Jeff Davidson83f8bc82017-05-15 10:22:20 -0700515 * eUICC, perform this action automatically. Otherwise, {@link #RESULT_MUST_DEACTIVATE_SIM}
516 * should be returned to allow the user to consent to this operation first.
517 * @return the result of the switch operation. May be one of the predefined {@code RESULT_}
518 * constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}.
Jeff Davidson91c3d072017-04-12 12:17:11 -0700519 * @see android.telephony.euicc.EuiccManager#switchToSubscription
520 */
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700521 public abstract @Result int onSwitchToSubscription(int slotId, @Nullable String iccid,
Jeff Davidson91c3d072017-04-12 12:17:11 -0700522 boolean forceDeactivateSim);
523
524 /**
525 * Update the nickname of the given subscription.
526 *
Holly Jiuyu Sun4f73b9c2017-12-12 20:17:09 -0800527 * @param slotId ID of the SIM slot to use for the operation.
Jeff Davidson91c3d072017-04-12 12:17:11 -0700528 * @param iccid the ICCID of the subscription to update.
529 * @param nickname the new nickname to apply.
Jeff Davidson83f8bc82017-05-15 10:22:20 -0700530 * @return the result of the update operation. May be one of the predefined {@code RESULT_}
531 * constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}.
Jeff Davidson91c3d072017-04-12 12:17:11 -0700532 * @see android.telephony.euicc.EuiccManager#updateSubscriptionNickname
533 */
Jeff Davidson83f8bc82017-05-15 10:22:20 -0700534 public abstract int onUpdateSubscriptionNickname(int slotId, String iccid,
Jeff Davidson91c3d072017-04-12 12:17:11 -0700535 String nickname);
536
537 /**
Peter Wang2ab852d2019-09-09 13:57:41 -0700538 * Erase all operational subscriptions on the device.
Jeff Davidson91c3d072017-04-12 12:17:11 -0700539 *
540 * <p>This is intended to be used for device resets. As such, the reset should be performed even
541 * if an active SIM must be deactivated in order to access the eUICC.
542 *
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700543 * @param slotId ID of the SIM slot to use for the operation.
Jeff Davidson83f8bc82017-05-15 10:22:20 -0700544 * @return the result of the erase operation. May be one of the predefined {@code RESULT_}
545 * constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}.
Jeff Davidson91c3d072017-04-12 12:17:11 -0700546 * @see android.telephony.euicc.EuiccManager#eraseSubscriptions
Peter Wang2ab852d2019-09-09 13:57:41 -0700547 *
548 * @deprecated From R, callers should specify a flag for specific set of subscriptions to erase
Peter Wang7e16b392019-11-12 15:44:58 -0800549 * and use {@link #onEraseSubscriptions(int, int)} instead
Jeff Davidson91c3d072017-04-12 12:17:11 -0700550 */
Peter Wang2ab852d2019-09-09 13:57:41 -0700551 @Deprecated
Jeff Davidson83f8bc82017-05-15 10:22:20 -0700552 public abstract int onEraseSubscriptions(int slotId);
Jeff Davidson91c3d072017-04-12 12:17:11 -0700553
554 /**
Peter Wang2ab852d2019-09-09 13:57:41 -0700555 * Erase specific subscriptions on the device.
556 *
557 * <p>This is intended to be used for device resets. As such, the reset should be performed even
558 * if an active SIM must be deactivated in order to access the eUICC.
559 *
560 * @param slotIndex index of the SIM slot to use for the operation.
561 * @param options flag for specific group of subscriptions to erase
562 * @return the result of the erase operation. May be one of the predefined {@code RESULT_}
563 * constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}.
564 * @see android.telephony.euicc.EuiccManager#eraseSubscriptionsWithOptions
565 */
Peter Wang7e16b392019-11-12 15:44:58 -0800566 public int onEraseSubscriptions(int slotIndex, @ResetOption int options) {
Peter Wang2ab852d2019-09-09 13:57:41 -0700567 throw new UnsupportedOperationException(
568 "This method must be overridden to enable the ResetOption parameter");
569 }
570
571 /**
Jeff Davidson7b69a862017-06-16 15:20:34 -0700572 * Ensure that subscriptions will be retained on the next factory reset.
573 *
574 * <p>Called directly before a factory reset. Assumes that a normal factory reset will lead to
575 * profiles being erased on first boot (to cover fastboot/recovery wipes), so the implementation
576 * should persist some bit that will remain accessible after the factory reset to bypass this
577 * flow when this method is called.
578 *
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700579 * @param slotId ID of the SIM slot to use for the operation.
Jeff Davidson7b69a862017-06-16 15:20:34 -0700580 * @return the result of the operation. May be one of the predefined {@code RESULT_} constants
581 * or any implementation-specific code starting with {@link #RESULT_FIRST_USER}.
582 */
583 public abstract int onRetainSubscriptionsForFactoryReset(int slotId);
584
585 /**
Jeff Davidson35cda392017-02-27 09:46:00 -0800586 * Wrapper around IEuiccService that forwards calls to implementations of {@link EuiccService}.
587 */
588 private class IEuiccServiceWrapper extends IEuiccService.Stub {
589 @Override
590 public void downloadSubscription(int slotId, DownloadableSubscription subscription,
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700591 boolean switchAfterDownload, boolean forceDeactivateSim, Bundle resolvedBundle,
Jeff Davidsoncfa70fa2017-04-06 16:02:36 -0700592 IDownloadSubscriptionCallback callback) {
Jeff Davidson707c3722017-06-12 11:40:52 -0700593 mExecutor.execute(new Runnable() {
594 @Override
595 public void run() {
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700596 DownloadSubscriptionResult result;
597 try {
598 result =
599 EuiccService.this.onDownloadSubscription(
600 slotId, subscription, switchAfterDownload, forceDeactivateSim,
601 resolvedBundle);
602 } catch (AbstractMethodError e) {
603 Log.w(TAG, "The new onDownloadSubscription(int, "
604 + "DownloadableSubscription, boolean, boolean, Bundle) is not "
605 + "implemented. Fall back to the old one.", e);
606 int resultCode = EuiccService.this.onDownloadSubscription(
607 slotId, subscription, switchAfterDownload, forceDeactivateSim);
608 result = new DownloadSubscriptionResult(resultCode,
Jordan Liucb47d1d2019-02-01 14:15:05 -0800609 0 /* resolvableErrors */, TelephonyManager.UNSUPPORTED_CARD_ID);
Holly Jiuyu Sun881fe4c2018-10-24 20:16:04 -0700610 }
Jeff Davidson707c3722017-06-12 11:40:52 -0700611 try {
612 callback.onComplete(result);
613 } catch (RemoteException e) {
614 // Can't communicate with the phone process; ignore.
615 }
616 }
617 });
Jeff Davidson35cda392017-02-27 09:46:00 -0800618 }
619
620 @Override
621 public void getEid(int slotId, IGetEidCallback callback) {
Jeff Davidson707c3722017-06-12 11:40:52 -0700622 mExecutor.execute(new Runnable() {
623 @Override
624 public void run() {
625 String eid = EuiccService.this.onGetEid(slotId);
626 try {
627 callback.onSuccess(eid);
628 } catch (RemoteException e) {
629 // Can't communicate with the phone process; ignore.
630 }
631 }
632 });
Jeff Davidson35cda392017-02-27 09:46:00 -0800633 }
634
635 @Override
Qingxi Li6019f9c2017-12-14 15:36:06 -0800636 public void startOtaIfNecessary(
637 int slotId, IOtaStatusChangedCallback statusChangedCallback) {
638 mExecutor.execute(new Runnable() {
639 @Override
640 public void run() {
641 EuiccService.this.onStartOtaIfNecessary(slotId, new OtaStatusChangedCallback() {
642 @Override
643 public void onOtaStatusChanged(int status) {
644 try {
645 statusChangedCallback.onOtaStatusChanged(status);
646 } catch (RemoteException e) {
647 // Can't communicate with the phone process; ignore.
648 }
649 }
650 });
651 }
652 });
653 }
654
655 @Override
Qingxi Li54058362017-12-13 15:13:02 -0800656 public void getOtaStatus(int slotId, IGetOtaStatusCallback callback) {
657 mExecutor.execute(new Runnable() {
658 @Override
659 public void run() {
660 int status = EuiccService.this.onGetOtaStatus(slotId);
661 try {
662 callback.onSuccess(status);
663 } catch (RemoteException e) {
664 // Can't communicate with the phone process; ignore.
665 }
666 }
667 });
668 }
669
670 @Override
Jeff Davidson35cda392017-02-27 09:46:00 -0800671 public void getDownloadableSubscriptionMetadata(int slotId,
672 DownloadableSubscription subscription,
Jeff Davidsoncfa70fa2017-04-06 16:02:36 -0700673 boolean forceDeactivateSim,
Jeff Davidson35cda392017-02-27 09:46:00 -0800674 IGetDownloadableSubscriptionMetadataCallback callback) {
Jeff Davidson707c3722017-06-12 11:40:52 -0700675 mExecutor.execute(new Runnable() {
676 @Override
677 public void run() {
678 GetDownloadableSubscriptionMetadataResult result =
679 EuiccService.this.onGetDownloadableSubscriptionMetadata(
680 slotId, subscription, forceDeactivateSim);
681 try {
682 callback.onComplete(result);
683 } catch (RemoteException e) {
684 // Can't communicate with the phone process; ignore.
685 }
686 }
687 });
Jeff Davidson35cda392017-02-27 09:46:00 -0800688 }
Jeff Davidsond02731f2017-04-09 14:31:09 -0700689
690 @Override
Jeff Davidson91c3d072017-04-12 12:17:11 -0700691 public void getDefaultDownloadableSubscriptionList(int slotId, boolean forceDeactivateSim,
692 IGetDefaultDownloadableSubscriptionListCallback callback) {
Jeff Davidson707c3722017-06-12 11:40:52 -0700693 mExecutor.execute(new Runnable() {
694 @Override
695 public void run() {
696 GetDefaultDownloadableSubscriptionListResult result =
697 EuiccService.this.onGetDefaultDownloadableSubscriptionList(
698 slotId, forceDeactivateSim);
699 try {
700 callback.onComplete(result);
701 } catch (RemoteException e) {
702 // Can't communicate with the phone process; ignore.
703 }
704 }
705 });
Jeff Davidson91c3d072017-04-12 12:17:11 -0700706 }
707
708 @Override
Jeff Davidsond02731f2017-04-09 14:31:09 -0700709 public void getEuiccProfileInfoList(int slotId, IGetEuiccProfileInfoListCallback callback) {
Jeff Davidson707c3722017-06-12 11:40:52 -0700710 mExecutor.execute(new Runnable() {
711 @Override
712 public void run() {
713 GetEuiccProfileInfoListResult result =
714 EuiccService.this.onGetEuiccProfileInfoList(slotId);
715 try {
716 callback.onComplete(result);
717 } catch (RemoteException e) {
718 // Can't communicate with the phone process; ignore.
719 }
720 }
721 });
Jeff Davidsond02731f2017-04-09 14:31:09 -0700722 }
Jeff Davidson91c3d072017-04-12 12:17:11 -0700723
724 @Override
725 public void getEuiccInfo(int slotId, IGetEuiccInfoCallback callback) {
Jeff Davidson707c3722017-06-12 11:40:52 -0700726 mExecutor.execute(new Runnable() {
727 @Override
728 public void run() {
729 EuiccInfo euiccInfo = EuiccService.this.onGetEuiccInfo(slotId);
730 try {
731 callback.onSuccess(euiccInfo);
732 } catch (RemoteException e) {
733 // Can't communicate with the phone process; ignore.
734 }
735 }
736 });
737
Jeff Davidson91c3d072017-04-12 12:17:11 -0700738 }
739
740 @Override
741 public void deleteSubscription(int slotId, String iccid,
742 IDeleteSubscriptionCallback callback) {
Jeff Davidson707c3722017-06-12 11:40:52 -0700743 mExecutor.execute(new Runnable() {
744 @Override
745 public void run() {
746 int result = EuiccService.this.onDeleteSubscription(slotId, iccid);
747 try {
748 callback.onComplete(result);
749 } catch (RemoteException e) {
750 // Can't communicate with the phone process; ignore.
751 }
752 }
753 });
Jeff Davidson91c3d072017-04-12 12:17:11 -0700754 }
755
756 @Override
757 public void switchToSubscription(int slotId, String iccid, boolean forceDeactivateSim,
758 ISwitchToSubscriptionCallback callback) {
Jeff Davidson707c3722017-06-12 11:40:52 -0700759 mExecutor.execute(new Runnable() {
760 @Override
761 public void run() {
762 int result =
763 EuiccService.this.onSwitchToSubscription(
764 slotId, iccid, forceDeactivateSim);
765 try {
766 callback.onComplete(result);
767 } catch (RemoteException e) {
768 // Can't communicate with the phone process; ignore.
769 }
770 }
771 });
Jeff Davidson91c3d072017-04-12 12:17:11 -0700772 }
773
774 @Override
775 public void updateSubscriptionNickname(int slotId, String iccid, String nickname,
776 IUpdateSubscriptionNicknameCallback callback) {
Jeff Davidson707c3722017-06-12 11:40:52 -0700777 mExecutor.execute(new Runnable() {
778 @Override
779 public void run() {
780 int result =
781 EuiccService.this.onUpdateSubscriptionNickname(slotId, iccid, nickname);
782 try {
783 callback.onComplete(result);
784 } catch (RemoteException e) {
785 // Can't communicate with the phone process; ignore.
786 }
787 }
788 });
Jeff Davidson91c3d072017-04-12 12:17:11 -0700789 }
790
791 @Override
792 public void eraseSubscriptions(int slotId, IEraseSubscriptionsCallback callback) {
Jeff Davidson707c3722017-06-12 11:40:52 -0700793 mExecutor.execute(new Runnable() {
794 @Override
795 public void run() {
796 int result = EuiccService.this.onEraseSubscriptions(slotId);
797 try {
798 callback.onComplete(result);
799 } catch (RemoteException e) {
800 // Can't communicate with the phone process; ignore.
801 }
802 }
803 });
Jeff Davidson91c3d072017-04-12 12:17:11 -0700804 }
Jeff Davidson7b69a862017-06-16 15:20:34 -0700805
806 @Override
Peter Wang2ab852d2019-09-09 13:57:41 -0700807 public void eraseSubscriptionsWithOptions(
808 int slotIndex, @ResetOption int options, IEraseSubscriptionsCallback callback) {
809 mExecutor.execute(new Runnable() {
810 @Override
811 public void run() {
Peter Wang7e16b392019-11-12 15:44:58 -0800812 int result = EuiccService.this.onEraseSubscriptions(slotIndex, options);
Peter Wang2ab852d2019-09-09 13:57:41 -0700813 try {
814 callback.onComplete(result);
815 } catch (RemoteException e) {
816 // Can't communicate with the phone process; ignore.
817 }
818 }
819 });
820 }
821
822 @Override
Jeff Davidson7b69a862017-06-16 15:20:34 -0700823 public void retainSubscriptionsForFactoryReset(int slotId,
824 IRetainSubscriptionsForFactoryResetCallback callback) {
825 mExecutor.execute(new Runnable() {
826 @Override
827 public void run() {
828 int result = EuiccService.this.onRetainSubscriptionsForFactoryReset(slotId);
829 try {
830 callback.onComplete(result);
831 } catch (RemoteException e) {
832 // Can't communicate with the phone process; ignore.
833 }
834 }
835 });
836 }
Jeff Davidson35cda392017-02-27 09:46:00 -0800837 }
838}