Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
dependencies ▾

Modern-Apps.git / library / aosp-stubs / src / main / java / android / service / euicc / EuiccService.java

EuiccService.java77 lines · 3.0 KiBRaw
1package android.service.euicc;
2
3import android.app.Service;
4import android.content.Intent;
5import android.os.IBinder;
6import android.telephony.euicc.DownloadableSubscription;
7import android.telephony.euicc.EuiccInfo;
8
9/**
10 * Compile-only stub of the framework's {@code @SystemApi}
11 * {@code android.service.euicc.EuiccService}. Mirrors the AOSP abstract surface
12 * the LPA must implement. Not packaged; the real class is provided by the
13 * framework at runtime.
14 */
15public abstract class EuiccService extends Service {
16 public static final int RESULT_OK = 0;
17 public static final int RESULT_MUST_DEACTIVATE_SIM = 1;
18 public static final int RESULT_RESOLVABLE_ERRORS = 2;
19 public static final int RESULT_FIRST_USER = 10;
20
21 public static final int OTA_STATUS_NOT_UPDATED = 1;
22
23 /**
24 * An abstract class upstream, not an interface. Mirrored as one here: a stub
25 * interface makes consumers emit {@code invokeinterface} for
26 * {@link #onOtaStatusChanged}, which the real abstract class rejects with
27 * {@code IncompatibleClassChangeError} on the OTA path.
28 */
29 public abstract static class OtaStatusChangedCallback {
30 public abstract void onOtaStatusChanged(int status);
31 }
32
33 @Override
34 public IBinder onBind(Intent intent) {
35 return null;
36 }
37
38 public abstract String onGetEid(int slotId);
39
40 public abstract int onGetOtaStatus(int slotId);
41
42 public abstract void onStartOtaIfNecessary(int slotId, OtaStatusChangedCallback statusChangedCallback);
43
44 public abstract GetDownloadableSubscriptionMetadataResult onGetDownloadableSubscriptionMetadata(
45 int slotId, DownloadableSubscription subscription, boolean forceDeactivateSim);
46
47 public abstract GetDefaultDownloadableSubscriptionListResult onGetDefaultDownloadableSubscriptionList(
48 int slotId, boolean forceDeactivateSim);
49
50 public abstract GetEuiccProfileInfoListResult onGetEuiccProfileInfoList(int slotId);
51
52 public abstract EuiccInfo onGetEuiccInfo(int slotId);
53
54 public abstract int onDeleteSubscription(int slotId, String iccid);
55
56 public abstract int onSwitchToSubscription(int slotId, String iccid, boolean forceDeactivateSim);
57
58 /**
59 * Port-aware switch (MEP devices). The framework's default throws
60 * {@code UnsupportedOperationException}, which crashes the LPA process when
61 * Settings calls it — every override must exist even on single-port eUICCs.
62 */
63 public int onSwitchToSubscriptionWithPort(
64 int slotId, int portIndex, String iccid, boolean forceDeactivateSim) {
65 throw new UnsupportedOperationException("LPA must override onSwitchToSubscriptionWithPort");
66 }
67
68 public abstract int onUpdateSubscriptionNickname(int slotId, String iccid, String nickname);
69
70 public abstract int onEraseSubscriptions(int slotId);
71
72 public abstract int onRetainSubscriptionsForFactoryReset(int slotId);
73
74 public abstract int onDownloadSubscription(
75 int slotId, DownloadableSubscription subscription, boolean switchAfterDownload,
76 boolean forceDeactivateSim);
77}