EuiccService.java 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. /*
  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. */
  16. package android.service.euicc;
  17. import android.app.Service;
  18. import android.content.Intent;
  19. import android.os.Bundle;
  20. import android.os.IBinder;
  21. import android.telephony.euicc.DownloadableSubscription;
  22. import android.telephony.euicc.EuiccInfo;
  23. import java.io.PrintWriter;
  24. /**
  25. * Service interface linking the system with an eUICC local profile assistant (LPA) application.
  26. *
  27. * <p>An LPA consists of two separate components (which may both be implemented in the same APK):
  28. * the LPA backend, and the LPA UI or LUI.
  29. *
  30. * @hide
  31. */
  32. public abstract class EuiccService extends Service {
  33. /** Action which must be included in this service's intent filter. */
  34. public static final String EUICC_SERVICE_INTERFACE = "android.service.euicc.EuiccService";
  35. /** Category which must be defined to all UI actions, for efficient lookup. */
  36. public static final String CATEGORY_EUICC_UI = "android.service.euicc.category.EUICC_UI";
  37. // LUI actions. These are passthroughs of the corresponding EuiccManager actions.
  38. /**
  39. * Action used to bind the carrier app and get the activation code from the carrier app. This
  40. * activation code will be used to download the eSIM profile during eSIM activation flow.
  41. */
  42. public static final String ACTION_BIND_CARRIER_PROVISIONING_SERVICE =
  43. "android.service.euicc.action.BIND_CARRIER_PROVISIONING_SERVICE";
  44. /**
  45. * Intent action sent by the LPA to launch a carrier app Activity for eSIM activation, e.g. a
  46. * carrier login screen. Carrier apps wishing to support this activation method must implement
  47. * an Activity that responds to this intent action. Upon completion, the Activity must return
  48. * one of the following results to the LPA:
  49. *
  50. * <p>{@code Activity.RESULT_CANCELED}: The LPA should treat this as an back button and abort
  51. * the activation flow.
  52. * <p>{@code Activity.RESULT_OK}: The LPA should try to get an activation code from the carrier
  53. * app by binding to the carrier app service implementing
  54. * {@link #ACTION_BIND_CARRIER_PROVISIONING_SERVICE}.
  55. * <p>{@code Activity.RESULT_OK} with
  56. * {@link android.telephony.euicc.EuiccManager#EXTRA_USE_QR_SCANNER} set to true: The LPA should
  57. * start a QR scanner for the user to scan an eSIM profile QR code.
  58. * <p>For other results: The LPA should treat this as an error.
  59. **/
  60. public static final String ACTION_START_CARRIER_ACTIVATION =
  61. "android.service.euicc.action.START_CARRIER_ACTIVATION";
  62. /**
  63. * @see android.telephony.euicc.EuiccManager#ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS
  64. * The difference is this one is used by system to bring up the LUI.
  65. */
  66. public static final String ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS =
  67. "android.service.euicc.action.MANAGE_EMBEDDED_SUBSCRIPTIONS";
  68. public static final String ACTION_PROVISION_EMBEDDED_SUBSCRIPTION =
  69. "android.service.euicc.action.PROVISION_EMBEDDED_SUBSCRIPTION";
  70. public static final String ACTION_TOGGLE_SUBSCRIPTION_PRIVILEGED =
  71. "android.service.euicc.action.TOGGLE_SUBSCRIPTION_PRIVILEGED";
  72. public static final String ACTION_DELETE_SUBSCRIPTION_PRIVILEGED =
  73. "android.service.euicc.action.DELETE_SUBSCRIPTION_PRIVILEGED";
  74. public static final String ACTION_RENAME_SUBSCRIPTION_PRIVILEGED =
  75. "android.service.euicc.action.RENAME_SUBSCRIPTION_PRIVILEGED";
  76. public static final String ACTION_START_EUICC_ACTIVATION =
  77. "android.service.euicc.action.START_EUICC_ACTIVATION";
  78. // LUI resolution actions. These are called by the platform to resolve errors in situations that
  79. // require user interaction.
  80. // TODO(b/33075886): Define extras for any input parameters to these dialogs once they are
  81. // more scoped out.
  82. /**
  83. * Alert the user that this action will result in an active SIM being deactivated.
  84. * To implement the LUI triggered by the system, you need to define this in AndroidManifest.xml.
  85. */
  86. public static final String ACTION_RESOLVE_DEACTIVATE_SIM =
  87. "android.service.euicc.action.RESOLVE_DEACTIVATE_SIM";
  88. /**
  89. * Alert the user about a download/switch being done for an app that doesn't currently have
  90. * carrier privileges.
  91. */
  92. public static final String ACTION_RESOLVE_NO_PRIVILEGES =
  93. "android.service.euicc.action.RESOLVE_NO_PRIVILEGES";
  94. /**
  95. * Ask the user to input carrier confirmation code.
  96. *
  97. * @deprecated From Q, the resolvable errors happened in the download step are presented as
  98. * bit map in {@link #EXTRA_RESOLVABLE_ERRORS}. The corresponding action would be
  99. * {@link #ACTION_RESOLVE_RESOLVABLE_ERRORS}.
  100. */
  101. @Deprecated
  102. public static final String ACTION_RESOLVE_CONFIRMATION_CODE =
  103. "android.service.euicc.action.RESOLVE_CONFIRMATION_CODE";
  104. /** Ask the user to resolve all the resolvable errors. */
  105. public static final String ACTION_RESOLVE_RESOLVABLE_ERRORS =
  106. "android.service.euicc.action.RESOLVE_RESOLVABLE_ERRORS";
  107. /**
  108. * Possible value for the bit map of resolvable errors indicating the download process needs
  109. * the user to input confirmation code.
  110. */
  111. public static final int RESOLVABLE_ERROR_CONFIRMATION_CODE = 1 << 0;
  112. /**
  113. * Possible value for the bit map of resolvable errors indicating the download process needs
  114. * the user's consent to allow profile policy rules.
  115. */
  116. public static final int RESOLVABLE_ERROR_POLICY_RULES = 1 << 1;
  117. /**
  118. * Intent extra set for resolution requests containing the package name of the calling app.
  119. * This is used by the above actions including ACTION_RESOLVE_DEACTIVATE_SIM,
  120. * ACTION_RESOLVE_NO_PRIVILEGES and ACTION_RESOLVE_RESOLVABLE_ERRORS.
  121. */
  122. public static final String EXTRA_RESOLUTION_CALLING_PACKAGE =
  123. "android.service.euicc.extra.RESOLUTION_CALLING_PACKAGE";
  124. /**
  125. * Intent extra set for resolution requests containing the list of resolvable errors to be
  126. * resolved. Each resolvable error is an integer. Its possible values include:
  127. * <UL>
  128. * <LI>{@link #RESOLVABLE_ERROR_CONFIRMATION_CODE}
  129. * <LI>{@link #RESOLVABLE_ERROR_POLICY_RULES}
  130. * </UL>
  131. */
  132. public static final String EXTRA_RESOLVABLE_ERRORS =
  133. "android.service.euicc.extra.RESOLVABLE_ERRORS";
  134. /**
  135. * Intent extra set for resolution requests containing a boolean indicating whether to ask the
  136. * user to retry another confirmation code.
  137. */
  138. public static final String EXTRA_RESOLUTION_CONFIRMATION_CODE_RETRIED =
  139. "android.service.euicc.extra.RESOLUTION_CONFIRMATION_CODE_RETRIED";
  140. /**
  141. * Intent extra set for resolution requests containing an int indicating the current card Id.
  142. */
  143. public static final String EXTRA_RESOLUTION_CARD_ID =
  144. "android.service.euicc.extra.RESOLUTION_CARD_ID";
  145. /**
  146. * Intent extra set for resolution requests containing an int indicating the current port index.
  147. */
  148. public static final String EXTRA_RESOLUTION_PORT_INDEX =
  149. "android.service.euicc.extra.RESOLUTION_PORT_INDEX";
  150. /**
  151. * Intent extra set for resolution requests containing a bool indicating whether to use the
  152. * given port index.
  153. */
  154. public static final String EXTRA_RESOLUTION_USE_PORT_INDEX =
  155. "android.service.euicc.extra.RESOLUTION_USE_PORT_INDEX";
  156. /** Result code for a successful operation. */
  157. public static final int RESULT_OK = 0;
  158. /** Result code indicating that an active SIM must be deactivated to perform the operation. */
  159. public static final int RESULT_MUST_DEACTIVATE_SIM = -1;
  160. /** Result code indicating that the user must resolve resolvable errors. */
  161. public static final int RESULT_RESOLVABLE_ERRORS = -2;
  162. /**
  163. * Result code indicating that the user must input a carrier confirmation code.
  164. *
  165. * @deprecated From Q, the resolvable errors happened in the download step are presented as
  166. * bit map in {@link #EXTRA_RESOLVABLE_ERRORS}. The corresponding result would be
  167. * {@link #RESULT_RESOLVABLE_ERRORS}.
  168. */
  169. @Deprecated
  170. public static final int RESULT_NEED_CONFIRMATION_CODE = -2;
  171. // New predefined codes should have negative values.
  172. /** Start of implementation-specific error results. */
  173. public static final int RESULT_FIRST_USER = 1;
  174. /**
  175. * Boolean extra for resolution actions indicating whether the user granted consent.
  176. * This is used and set by the implementation and used in {@code EuiccOperation}.
  177. */
  178. public static final String EXTRA_RESOLUTION_CONSENT =
  179. "android.service.euicc.extra.RESOLUTION_CONSENT";
  180. /**
  181. * String extra for resolution actions indicating the carrier confirmation code.
  182. * This is used and set by the implementation and used in {@code EuiccOperation}.
  183. */
  184. public static final String EXTRA_RESOLUTION_CONFIRMATION_CODE =
  185. "android.service.euicc.extra.RESOLUTION_CONFIRMATION_CODE";
  186. /**
  187. * String extra for resolution actions indicating whether the user allows policy rules.
  188. * This is used and set by the implementation and used in {@code EuiccOperation}.
  189. */
  190. public static final String EXTRA_RESOLUTION_ALLOW_POLICY_RULES =
  191. "android.service.euicc.extra.RESOLUTION_ALLOW_POLICY_RULES";
  192. public EuiccService() {
  193. }
  194. /**
  195. * Given a SubjectCode[5.2.6.1] and ReasonCode[5.2.6.2] from GSMA (SGP.22 v2.2), encode it to
  196. * the format described in
  197. * {@link android.telephony.euicc.EuiccManager#OPERATION_SMDX_SUBJECT_REASON_CODE}
  198. *
  199. * @param subjectCode SubjectCode[5.2.6.1] from GSMA (SGP.22 v2.2)
  200. * @param reasonCode ReasonCode[5.2.6.2] from GSMA (SGP.22 v2.2)
  201. * @return encoded error code described in
  202. * {@link android.telephony.euicc.EuiccManager#OPERATION_SMDX_SUBJECT_REASON_CODE}
  203. * @throws NumberFormatException when the Subject/Reason code contains non digits
  204. * @throws IllegalArgumentException when Subject/Reason code is null/empty
  205. * @throws UnsupportedOperationException when sections has more than four layers (e.g 5.8.1.2)
  206. * or when an number is bigger than 15
  207. */
  208. public int encodeSmdxSubjectAndReasonCode(String subjectCode,
  209. String reasonCode) {
  210. return 0;
  211. }
  212. @Override
  213. public void onCreate() {
  214. super.onCreate();
  215. }
  216. @Override
  217. public void onDestroy() {
  218. super.onDestroy();
  219. }
  220. /**
  221. * If overriding this method, call through to the super method for any unknown actions.
  222. * {@inheritDoc}
  223. */
  224. @Override
  225. public IBinder onBind(Intent intent) {
  226. return null;
  227. }
  228. /**
  229. * Callback class for {@link #onStartOtaIfNecessary(int, OtaStatusChangedCallback)}
  230. *
  231. * The status of OTA which can be {@code android.telephony.euicc.EuiccManager#EUICC_OTA_}
  232. */
  233. public abstract static class OtaStatusChangedCallback {
  234. /** Called when OTA status is changed. */
  235. public abstract void onOtaStatusChanged(int status);
  236. }
  237. /**
  238. * Return the EID of the eUICC.
  239. *
  240. * @param slotId ID of the SIM slot being queried.
  241. * @return the EID.
  242. * @see android.telephony.euicc.EuiccManager#getEid
  243. */
  244. // TODO(b/36260308): Update doc when we have multi-SIM support.
  245. public abstract String onGetEid(int slotId);
  246. /**
  247. * Return the status of OTA update.
  248. *
  249. * @param slotId ID of the SIM slot to use for the operation.
  250. * @return The status of Euicc OTA update.
  251. */
  252. public abstract int onGetOtaStatus(int slotId);
  253. /**
  254. * Perform OTA if current OS is not the latest one.
  255. *
  256. * @param slotId ID of the SIM slot to use for the operation.
  257. * @param statusChangedCallback Function called when OTA status changed.
  258. */
  259. public abstract void onStartOtaIfNecessary(
  260. int slotId, OtaStatusChangedCallback statusChangedCallback);
  261. /**
  262. * Populate {@link DownloadableSubscription} metadata for the given downloadable subscription.
  263. *
  264. * @param slotId ID of the SIM slot to use for the operation.
  265. * @param subscription A subscription whose metadata needs to be populated.
  266. * @param forceDeactivateSim If true, and if an active SIM must be deactivated to access the
  267. * eUICC, perform this action automatically. Otherwise, {@link #RESULT_MUST_DEACTIVATE_SIM)}
  268. * should be returned to allow the user to consent to this operation first.
  269. * @return The result of the operation.
  270. */
  271. public abstract GetDownloadableSubscriptionMetadataResult onGetDownloadableSubscriptionMetadata(
  272. int slotId, DownloadableSubscription subscription, boolean forceDeactivateSim);
  273. /**
  274. * Return metadata for subscriptions which are available for download for this device.
  275. *
  276. * @param slotId ID of the SIM slot to use for the operation.
  277. * @param forceDeactivateSim If true, and if an active SIM must be deactivated to access the
  278. * eUICC, perform this action automatically. Otherwise, {@link #RESULT_MUST_DEACTIVATE_SIM)}
  279. * should be returned to allow the user to consent to this operation first.
  280. * @return The result of the list operation.
  281. */
  282. public abstract GetDefaultDownloadableSubscriptionListResult
  283. onGetDefaultDownloadableSubscriptionList(int slotId, boolean forceDeactivateSim);
  284. /**
  285. * Download the given subscription.
  286. *
  287. * @param slotId ID of the SIM slot to use for the operation.
  288. * @param subscription The subscription to download.
  289. * @param switchAfterDownload If true, the subscription should be enabled upon successful
  290. * download.
  291. * @param forceDeactivateSim If true, and if an active SIM must be deactivated to access the
  292. * eUICC, perform this action automatically. Otherwise, {@link #RESULT_MUST_DEACTIVATE_SIM}
  293. * should be returned to allow the user to consent to this operation first.
  294. * @param resolvedBundle The bundle containing information on resolved errors. It can contain
  295. * a string of confirmation code for the key {@link #EXTRA_RESOLUTION_CONFIRMATION_CODE},
  296. * and a boolean for key {@link #EXTRA_RESOLUTION_ALLOW_POLICY_RULES} indicating whether
  297. * the user allows profile policy rules or not.
  298. * @return a DownloadSubscriptionResult instance including a result code, a resolvable errors
  299. * bit map, and original the card Id. The result code may be one of the predefined
  300. * {@code RESULT_} constants or any implementation-specific code starting with
  301. * {@link #RESULT_FIRST_USER}. The resolvable error bit map can be either 0 or values
  302. * defined in {@code RESOLVABLE_ERROR_}. A subclass should override this method. Otherwise,
  303. * this method does nothing and returns null by default.
  304. * @see android.telephony.euicc.EuiccManager#downloadSubscription
  305. */
  306. public DownloadSubscriptionResult onDownloadSubscription(int slotId,
  307. DownloadableSubscription subscription, boolean switchAfterDownload,
  308. boolean forceDeactivateSim, Bundle resolvedBundle) {
  309. return null;
  310. }
  311. /**
  312. * Download the given subscription.
  313. *
  314. * @param slotId ID of the SIM slot to use for the operation.
  315. * @param subscription The subscription to download.
  316. * @param switchAfterDownload If true, the subscription should be enabled upon successful
  317. * download.
  318. * @param forceDeactivateSim If true, and if an active SIM must be deactivated to access the
  319. * eUICC, perform this action automatically. Otherwise, {@link #RESULT_MUST_DEACTIVATE_SIM}
  320. * should be returned to allow the user to consent to this operation first.
  321. * @return the result of the download operation. May be one of the predefined {@code RESULT_}
  322. * constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}.
  323. * @see android.telephony.euicc.EuiccManager#downloadSubscription
  324. *
  325. * @deprecated From Q, a subclass should use and override the above
  326. * {@link #onDownloadSubscription(int, DownloadableSubscription, boolean, boolean, Bundle)}. The
  327. * default return value for this one is Integer.MIN_VALUE.
  328. */
  329. @Deprecated public int onDownloadSubscription(int slotId,
  330. DownloadableSubscription subscription, boolean switchAfterDownload,
  331. boolean forceDeactivateSim) {
  332. return Integer.MIN_VALUE;
  333. }
  334. /**
  335. * Return a list of all @link EuiccProfileInfo}s.
  336. *
  337. * @param slotId ID of the SIM slot to use for the operation.
  338. * @return The result of the operation.
  339. * @see android.telephony.SubscriptionManager#getAccessibleSubscriptionInfoList
  340. */
  341. public abstract GetEuiccProfileInfoListResult onGetEuiccProfileInfoList(int slotId);
  342. /**
  343. * Return info about the eUICC chip/device.
  344. *
  345. * @param slotId ID of the SIM slot to use for the operation.
  346. * @return the {@link EuiccInfo} for the eUICC chip/device.
  347. * @see android.telephony.euicc.EuiccManager#getEuiccInfo
  348. */
  349. public abstract EuiccInfo onGetEuiccInfo(int slotId);
  350. /**
  351. * Delete the given subscription.
  352. *
  353. * <p>If the subscription is currently active, it should be deactivated first (equivalent to a
  354. * physical SIM being ejected).
  355. *
  356. * @param slotId ID of the SIM slot to use for the operation.
  357. * @param iccid the ICCID of the subscription to delete.
  358. * @return the result of the delete operation. May be one of the predefined {@code RESULT_}
  359. * constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}.
  360. * @see android.telephony.euicc.EuiccManager#deleteSubscription
  361. */
  362. public abstract int onDeleteSubscription(int slotId, String iccid);
  363. /**
  364. * Switch to the given subscription.
  365. *
  366. * @param slotId ID of the SIM slot to use for the operation.
  367. * @param iccid the ICCID of the subscription to enable. May be null, in which case the current
  368. * profile should be deactivated and no profile should be activated to replace it - this is
  369. * equivalent to a physical SIM being ejected.
  370. * @param forceDeactivateSim If true, and if an active SIM must be deactivated to access the
  371. * eUICC, perform this action automatically. Otherwise, {@link #RESULT_MUST_DEACTIVATE_SIM}
  372. * should be returned to allow the user to consent to this operation first.
  373. * @return the result of the switch operation. May be one of the predefined {@code RESULT_}
  374. * constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}.
  375. * @see android.telephony.euicc.EuiccManager#switchToSubscription
  376. *
  377. * @deprecated prefer {@link #onSwitchToSubscriptionWithPort(int, int, String, boolean)}
  378. */
  379. @Deprecated public abstract int onSwitchToSubscription(int slotId,
  380. String iccid, boolean forceDeactivateSim);
  381. /**
  382. * Switch to the given subscription.
  383. *
  384. * @param slotId ID of the SIM slot to use for the operation.
  385. * @param portIndex which port on the eUICC to use
  386. * @param iccid the ICCID of the subscription to enable. May be null, in which case the current
  387. * profile should be deactivated and no profile should be activated to replace it - this is
  388. * equivalent to a physical SIM being ejected.
  389. * @param forceDeactivateSim If true, and if an active SIM must be deactivated to access the
  390. * eUICC, perform this action automatically. Otherwise, {@link #RESULT_MUST_DEACTIVATE_SIM}
  391. * should be returned to allow the user to consent to this operation first.
  392. * @return the result of the switch operation. May be one of the predefined {@code RESULT_}
  393. * constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}.
  394. * @see android.telephony.euicc.EuiccManager#switchToSubscription
  395. */
  396. public int onSwitchToSubscriptionWithPort(int slotId, int portIndex,
  397. String iccid, boolean forceDeactivateSim) {
  398. // stub implementation, LPA needs to implement this
  399. throw new UnsupportedOperationException("LPA must override onSwitchToSubscriptionWithPort");
  400. }
  401. /**
  402. * Update the nickname of the given subscription.
  403. *
  404. * @param slotId ID of the SIM slot to use for the operation.
  405. * @param iccid the ICCID of the subscription to update.
  406. * @param nickname the new nickname to apply.
  407. * @return the result of the update operation. May be one of the predefined {@code RESULT_}
  408. * constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}.
  409. * @see android.telephony.euicc.EuiccManager#updateSubscriptionNickname
  410. */
  411. public abstract int onUpdateSubscriptionNickname(int slotId, String iccid,
  412. String nickname);
  413. /**
  414. * Erase all operational subscriptions on the device.
  415. *
  416. * <p>This is intended to be used for device resets. As such, the reset should be performed even
  417. * if an active SIM must be deactivated in order to access the eUICC.
  418. *
  419. * @param slotId ID of the SIM slot to use for the operation.
  420. * @return the result of the erase operation. May be one of the predefined {@code RESULT_}
  421. * constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}.
  422. *
  423. * @deprecated From R, callers should specify a flag for specific set of subscriptions to erase
  424. * and use {@link #onEraseSubscriptions(int, int)} instead
  425. */
  426. @Deprecated
  427. public abstract int onEraseSubscriptions(int slotId);
  428. /**
  429. * Erase specific subscriptions on the device.
  430. *
  431. * <p>This is intended to be used for device resets. As such, the reset should be performed even
  432. * if an active SIM must be deactivated in order to access the eUICC.
  433. *
  434. * @param slotIndex index of the SIM slot to use for the operation.
  435. * @param options flag for specific group of subscriptions to erase
  436. * @return the result of the erase operation. May be one of the predefined {@code RESULT_}
  437. * constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}.
  438. */
  439. public int onEraseSubscriptions(int slotIndex, int options) {
  440. throw new UnsupportedOperationException(
  441. "This method must be overridden to enable the ResetOption parameter");
  442. }
  443. /**
  444. * Ensure that subscriptions will be retained on the next factory reset.
  445. *
  446. * <p>Called directly before a factory reset. Assumes that a normal factory reset will lead to
  447. * profiles being erased on first boot (to cover fastboot/recovery wipes), so the implementation
  448. * should persist some bit that will remain accessible after the factory reset to bypass this
  449. * flow when this method is called.
  450. *
  451. * @param slotId ID of the SIM slot to use for the operation.
  452. * @return the result of the operation. May be one of the predefined {@code RESULT_} constants
  453. * or any implementation-specific code starting with {@link #RESULT_FIRST_USER}.
  454. */
  455. public abstract int onRetainSubscriptionsForFactoryReset(int slotId);
  456. /**
  457. * Dump to a provided printWriter.
  458. */
  459. public void dump(PrintWriter printWriter) {
  460. printWriter.println("The connected LPA does not implement EuiccService#dump()");
  461. }
  462. }