diff --git a/Android.mk b/Android.mk index a4d1107286b3d..5529bfcfe787b 100644 --- a/Android.mk +++ b/Android.mk @@ -283,11 +283,17 @@ LOCAL_SRC_FILES += \ core/java/android/service/carrier/ICarrierService.aidl \ core/java/android/service/carrier/ICarrierMessagingCallback.aidl \ core/java/android/service/carrier/ICarrierMessagingService.aidl \ + core/java/android/service/euicc/IDeleteSubscriptionCallback.aidl \ core/java/android/service/euicc/IDownloadSubscriptionCallback.aidl \ + core/java/android/service/euicc/IEraseSubscriptionsCallback.aidl \ core/java/android/service/euicc/IEuiccService.aidl \ + core/java/android/service/euicc/IGetDefaultDownloadableSubscriptionListCallback.aidl \ core/java/android/service/euicc/IGetDownloadableSubscriptionMetadataCallback.aidl \ core/java/android/service/euicc/IGetEidCallback.aidl \ + core/java/android/service/euicc/IGetEuiccInfoCallback.aidl \ core/java/android/service/euicc/IGetEuiccProfileInfoListCallback.aidl \ + core/java/android/service/euicc/ISwitchToSubscriptionCallback.aidl \ + core/java/android/service/euicc/IUpdateSubscriptionNicknameCallback.aidl \ core/java/android/service/gatekeeper/IGateKeeperService.aidl \ core/java/android/service/notification/INotificationListener.aidl \ core/java/android/service/notification/IStatusBarNotificationHolder.aidl \ @@ -640,6 +646,7 @@ aidl_files := \ frameworks/base/telephony/java/android/telephony/ModemActivityInfo.aidl \ frameworks/base/telephony/java/android/telephony/UiccAccessRule.aidl \ frameworks/base/telephony/java/android/telephony/euicc/DownloadableSubscription.aidl \ + frameworks/base/telephony/java/android/telephony/euicc/EuiccInfo.aidl \ frameworks/base/location/java/android/location/Location.aidl \ frameworks/base/location/java/android/location/Address.aidl \ frameworks/base/location/java/android/location/Criteria.aidl \ @@ -753,9 +760,14 @@ aidl_files := \ frameworks/base/core/java/android/view/textservice/SuggestionsInfo.aidl \ frameworks/base/core/java/android/service/carrier/CarrierIdentifier.aidl \ frameworks/base/core/java/android/service/carrier/MessagePdu.aidl \ + frameworks/base/core/java/android/service/euicc/DeleteResult.aidl \ frameworks/base/core/java/android/service/euicc/DownloadResult.aidl \ + frameworks/base/core/java/android/service/euicc/EraseResult.aidl \ + frameworks/base/core/java/android/service/euicc/GetDefaultDownloadableSubscriptionListResult.aidl \ frameworks/base/core/java/android/service/euicc/GetDownloadableSubscriptionMetadataResult.aidl \ frameworks/base/core/java/android/service/euicc/GetEuiccProfileInfoListResult.aidl \ + frameworks/base/core/java/android/service/euicc/SwitchResult.aidl \ + frameworks/base/core/java/android/service/euicc/UpdateNicknameResult.aidl \ frameworks/base/core/java/android/service/notification/Adjustment.aidl \ frameworks/base/core/java/android/service/notification/Condition.aidl \ frameworks/base/core/java/android/service/notification/SnoozeCriterion.aidl \ diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 39f48df6d946e..e32d884f471fe 100755 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -7651,6 +7651,21 @@ public final class Settings { */ public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external"; + /** + * The default SM-DP+ configured for this device. + * + *
An SM-DP+ is used by an LPA (see {@link android.service.euicc.EuiccService}) to
+ * download profiles. If this value is set, the LPA will query this server for any profiles
+ * available to this device. If any are available, they may be downloaded during device
+ * provisioning or in settings without needing the user to enter an activation code.
+ *
+ * @see android.service.euicc.EuiccService
+ * @hide
+ *
+ * TODO(b/35851809): Make this a SystemApi.
+ */
+ public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus";
+
/**
* Whether any activity can be resized. When this is true, any
* activity, regardless of manifest values, can be resized for multi-window.
diff --git a/core/java/android/service/euicc/DeleteResult.aidl b/core/java/android/service/euicc/DeleteResult.aidl
new file mode 100644
index 0000000000000..3da8b49fb9ffa
--- /dev/null
+++ b/core/java/android/service/euicc/DeleteResult.aidl
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.service.euicc;
+
+parcelable DeleteResult;
diff --git a/core/java/android/service/euicc/DeleteResult.java b/core/java/android/service/euicc/DeleteResult.java
new file mode 100644
index 0000000000000..8be9ac9543dfd
--- /dev/null
+++ b/core/java/android/service/euicc/DeleteResult.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.service.euicc;
+
+import android.annotation.IntDef;
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Result of a {@link EuiccService#onDeleteSubscription} operation.
+ * @hide
+ *
+ * TODO(b/35851809): Make this a SystemApi.
+ */
+public final class DeleteResult implements Parcelable {
+
+ public static final Creator If the subscription is currently active, it should be deactivated first (equivalent to a
+ * physical SIM being ejected).
+ *
+ * @param slotId ID of the SIM slot to use for the operation. This is currently not populated
+ * but is here to future-proof the APIs.
+ * @param iccid the ICCID of the subscription to delete.
+ * @return the result of the delete operation.
+ * @see android.telephony.euicc.EuiccManager#deleteSubscription
+ */
+ public abstract DeleteResult onDeleteSubscription(int slotId, String iccid);
+
+ /**
+ * Switch to the given subscription.
+ *
+ * @param slotId ID of the SIM slot to use for the operation. This is currently not populated
+ * but is here to future-proof the APIs.
+ * @param iccid the ICCID of the subscription to enable. May be null, in which case the current
+ * profile should be deactivated and no profile should be activated to replace it - this is
+ * equivalent to a physical SIM being ejected.
+ * @param forceDeactivateSim If true, and if an active SIM must be deactivated to access the
+ * eUICC, perform this action automatically. Otherwise,
+ * {@link SwitchResult#mustDeactivateSim()} should be returned to allow the user to consent
+ * to this operation first.
+ * @return the result of the switch operation.
+ * @see android.telephony.euicc.EuiccManager#switchToSubscription
+ */
+ public abstract SwitchResult onSwitchToSubscription(int slotId, @Nullable String iccid,
+ boolean forceDeactivateSim);
+
+ /**
+ * Update the nickname of the given subscription.
+ *
+ * @param slotId ID of the SIM slot to use for the operation. This is currently not populated
+ * but is here to future-proof the APIs.
+ * @param iccid the ICCID of the subscription to update.
+ * @param nickname the new nickname to apply.
+ * @return the result of the update operation.
+ * @see android.telephony.euicc.EuiccManager#updateSubscriptionNickname
+ */
+ public abstract UpdateNicknameResult onUpdateSubscriptionNickname(int slotId, String iccid,
+ String nickname);
+
+ /**
+ * Erase all of the subscriptions on the device.
+ *
+ * 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 slotId ID of the SIM slot to use for the operation. This is currently not populated
+ * but is here to future-proof the APIs.
+ * @return the result of the erase operation.
+ * @see android.telephony.euicc.EuiccManager#eraseSubscriptions
+ */
+ public abstract EraseResult onEraseSubscriptions(int slotId);
+
/**
* Wrapper around IEuiccService that forwards calls to implementations of {@link EuiccService}.
*/
@@ -183,7 +268,7 @@ public abstract class EuiccService extends Service {
public void downloadSubscription(int slotId, DownloadableSubscription subscription,
boolean switchAfterDownload, boolean forceDeactivateSim,
IDownloadSubscriptionCallback callback) {
- DownloadResult result = EuiccService.this.downloadSubscription(
+ DownloadResult result = EuiccService.this.onDownloadSubscription(
slotId, subscription, switchAfterDownload, forceDeactivateSim);
try {
callback.onComplete(result);
@@ -208,7 +293,7 @@ public abstract class EuiccService extends Service {
boolean forceDeactivateSim,
IGetDownloadableSubscriptionMetadataCallback callback) {
GetDownloadableSubscriptionMetadataResult result =
- EuiccService.this.getDownloadableSubscriptionMetadata(
+ EuiccService.this.onGetDownloadableSubscriptionMetadata(
slotId, subscription, forceDeactivateSim);
try {
callback.onComplete(result);
@@ -217,6 +302,19 @@ public abstract class EuiccService extends Service {
}
}
+ @Override
+ public void getDefaultDownloadableSubscriptionList(int slotId, boolean forceDeactivateSim,
+ IGetDefaultDownloadableSubscriptionListCallback callback) {
+ GetDefaultDownloadableSubscriptionListResult result =
+ EuiccService.this.onGetDefaultDownloadableSubscriptionList(
+ slotId, forceDeactivateSim);
+ try {
+ callback.onComplete(result);
+ } catch (RemoteException e) {
+ // Can't communicate with the phone process; ignore.
+ }
+ }
+
@Override
public void getEuiccProfileInfoList(int slotId, IGetEuiccProfileInfoListCallback callback) {
GetEuiccProfileInfoListResult result =
@@ -227,5 +325,60 @@ public abstract class EuiccService extends Service {
// Can't communicate with the phone process; ignore.
}
}
+
+ @Override
+ public void getEuiccInfo(int slotId, IGetEuiccInfoCallback callback) {
+ EuiccInfo euiccInfo = EuiccService.this.onGetEuiccInfo(slotId);
+ try {
+ callback.onSuccess(euiccInfo);
+ } catch (RemoteException e) {
+ // Can't communicate with the phone process; ignore.
+ }
+ }
+
+ @Override
+ public void deleteSubscription(int slotId, String iccid,
+ IDeleteSubscriptionCallback callback) {
+ DeleteResult result = EuiccService.this.onDeleteSubscription(slotId, iccid);
+ try {
+ callback.onComplete(result);
+ } catch (RemoteException e) {
+ // Can't communicate with the phone process; ignore.
+ }
+ }
+
+ @Override
+ public void switchToSubscription(int slotId, String iccid, boolean forceDeactivateSim,
+ ISwitchToSubscriptionCallback callback) {
+ SwitchResult result =
+ EuiccService.this.onSwitchToSubscription(slotId, iccid, forceDeactivateSim);
+ try {
+ callback.onComplete(result);
+ } catch (RemoteException e) {
+ // Can't communicate with the phone process; ignore.
+ }
+ }
+
+ @Override
+ public void updateSubscriptionNickname(int slotId, String iccid, String nickname,
+ IUpdateSubscriptionNicknameCallback callback) {
+ UpdateNicknameResult result =
+ EuiccService.this.onUpdateSubscriptionNickname(slotId, iccid, nickname);
+ try {
+ callback.onComplete(result);
+ } catch (RemoteException e) {
+ // Can't communicate with the phone process; ignore.
+ }
+ }
+
+ @Override
+ public void eraseSubscriptions(int slotId, IEraseSubscriptionsCallback callback) {
+ EraseResult result = EuiccService.this.onEraseSubscriptions(slotId);
+ try {
+ callback.onComplete(result);
+ } catch (RemoteException e) {
+ // Can't communicate with the phone process; ignore.
+ }
+ }
}
}
diff --git a/core/java/android/service/euicc/GetDefaultDownloadableSubscriptionListResult.aidl b/core/java/android/service/euicc/GetDefaultDownloadableSubscriptionListResult.aidl
new file mode 100644
index 0000000000000..c2636a16edee6
--- /dev/null
+++ b/core/java/android/service/euicc/GetDefaultDownloadableSubscriptionListResult.aidl
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.service.euicc;
+
+parcelable GetDefaultDownloadableSubscriptionListResult;
diff --git a/core/java/android/service/euicc/GetDefaultDownloadableSubscriptionListResult.java b/core/java/android/service/euicc/GetDefaultDownloadableSubscriptionListResult.java
new file mode 100644
index 0000000000000..95569b27e7632
--- /dev/null
+++ b/core/java/android/service/euicc/GetDefaultDownloadableSubscriptionListResult.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.service.euicc;
+
+import android.annotation.IntDef;
+import android.annotation.Nullable;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.telephony.euicc.DownloadableSubscription;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Result of a {@link EuiccService#onGetDefaultDownloadableSubscriptionList} operation.
+ * @hide
+ *
+ * TODO(b/35851809): Make this a SystemApi.
+ */
+public final class GetDefaultDownloadableSubscriptionListResult implements Parcelable {
+
+ public static final Creator Only non-null if {@link #result} is {@link #RESULT_OK}.
+ */
+ @Nullable
+ public final DownloadableSubscription[] subscriptions;
+
+ /** Implementation-defined detailed error code in case of a failure not covered here. */
+ public final int detailedCode;
+
+ private GetDefaultDownloadableSubscriptionListResult(int result,
+ @Nullable DownloadableSubscription[] subscriptions, int detailedCode) {
+ this.result = result;
+ this.subscriptions = subscriptions;
+ this.detailedCode = detailedCode;
+ }
+
+ private GetDefaultDownloadableSubscriptionListResult(Parcel in) {
+ this.result = in.readInt();
+ this.subscriptions = in.createTypedArray(DownloadableSubscription.CREATOR);
+ this.detailedCode = in.readInt();
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeInt(result);
+ dest.writeTypedArray(subscriptions, flags);
+ dest.writeInt(detailedCode);
+ }
+
+ /** Return a result indicating that the list operation was successful. */
+ public static GetDefaultDownloadableSubscriptionListResult success(
+ DownloadableSubscription[] subscriptions) {
+ return new GetDefaultDownloadableSubscriptionListResult(RESULT_OK, subscriptions,
+ 0 /* detailedCode */);
+ }
+
+ /**
+ * Return a result indicating that an active SIM must be deactivated to perform the operation.
+ */
+ public static GetDefaultDownloadableSubscriptionListResult mustDeactivateSim() {
+ return new GetDefaultDownloadableSubscriptionListResult(RESULT_MUST_DEACTIVATE_SIM,
+ null /* subscription */, 0 /* detailedCode */);
+ }
+
+ /**
+ * Return a result indicating that an error occurred for which no other more specific error
+ * code has been defined.
+ *
+ * @param detailedCode an implementation-defined detailed error code for debugging purposes.
+ */
+ public static GetDefaultDownloadableSubscriptionListResult genericError(int detailedCode) {
+ return new GetDefaultDownloadableSubscriptionListResult(RESULT_GENERIC_ERROR,
+ null /* subscription */, detailedCode);
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+}
diff --git a/core/java/android/service/euicc/GetDownloadableSubscriptionMetadataResult.java b/core/java/android/service/euicc/GetDownloadableSubscriptionMetadataResult.java
index ca3c1597fa58b..99e7614cbf08a 100644
--- a/core/java/android/service/euicc/GetDownloadableSubscriptionMetadataResult.java
+++ b/core/java/android/service/euicc/GetDownloadableSubscriptionMetadataResult.java
@@ -25,7 +25,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
- * Result of a {@link EuiccService#getDownloadableSubscriptionMetadata} operation.
+ * Result of a {@link EuiccService#onGetDownloadableSubscriptionMetadata} operation.
* @hide
*
* TODO(b/35851809): Make this a SystemApi.
@@ -92,7 +92,7 @@ public final class GetDownloadableSubscriptionMetadataResult implements Parcelab
dest.writeInt(detailedCode);
}
- /** Return a result indicating that the download was successful. */
+ /** Return a result indicating that the lookup was successful. */
public static GetDownloadableSubscriptionMetadataResult success(
DownloadableSubscription subscription) {
return new GetDownloadableSubscriptionMetadataResult(RESULT_OK, subscription,
diff --git a/core/java/android/service/euicc/IDeleteSubscriptionCallback.aidl b/core/java/android/service/euicc/IDeleteSubscriptionCallback.aidl
new file mode 100644
index 0000000000000..224cbd3bd6418
--- /dev/null
+++ b/core/java/android/service/euicc/IDeleteSubscriptionCallback.aidl
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.service.euicc;
+
+import android.service.euicc.DeleteResult;
+
+/** @hide */
+oneway interface IDeleteSubscriptionCallback {
+ void onComplete(in DeleteResult result);
+}
\ No newline at end of file
diff --git a/core/java/android/service/euicc/IEraseSubscriptionsCallback.aidl b/core/java/android/service/euicc/IEraseSubscriptionsCallback.aidl
new file mode 100644
index 0000000000000..aa70e767242e7
--- /dev/null
+++ b/core/java/android/service/euicc/IEraseSubscriptionsCallback.aidl
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.service.euicc;
+
+import android.service.euicc.EraseResult;
+
+/** @hide */
+oneway interface IEraseSubscriptionsCallback {
+ void onComplete(in EraseResult result);
+}
\ No newline at end of file
diff --git a/core/java/android/service/euicc/IEuiccService.aidl b/core/java/android/service/euicc/IEuiccService.aidl
index 502fc844977ed..18ea915d5dc7c 100644
--- a/core/java/android/service/euicc/IEuiccService.aidl
+++ b/core/java/android/service/euicc/IEuiccService.aidl
@@ -16,10 +16,16 @@
package android.service.euicc;
+import android.service.euicc.IDeleteSubscriptionCallback;
import android.service.euicc.IDownloadSubscriptionCallback;
+import android.service.euicc.IEraseSubscriptionsCallback;
+import android.service.euicc.IGetDefaultDownloadableSubscriptionListCallback;
import android.service.euicc.IGetDownloadableSubscriptionMetadataCallback;
import android.service.euicc.IGetEidCallback;
+import android.service.euicc.IGetEuiccInfoCallback;
import android.service.euicc.IGetEuiccProfileInfoListCallback;
+import android.service.euicc.ISwitchToSubscriptionCallback;
+import android.service.euicc.IUpdateSubscriptionNicknameCallback;
import android.telephony.euicc.DownloadableSubscription;
/** @hide */
@@ -31,4 +37,13 @@ oneway interface IEuiccService {
boolean forceDeactivateSim, in IGetDownloadableSubscriptionMetadataCallback callback);
void getEid(int slotId, in IGetEidCallback callback);
void getEuiccProfileInfoList(int slotId, in IGetEuiccProfileInfoListCallback callback);
+ void getDefaultDownloadableSubscriptionList(int slotId, boolean forceDeactivateSim,
+ in IGetDefaultDownloadableSubscriptionListCallback callback);
+ void getEuiccInfo(int slotId, in IGetEuiccInfoCallback callback);
+ void deleteSubscription(int slotId, String iccid, in IDeleteSubscriptionCallback callback);
+ void switchToSubscription(int slotId, String iccid, boolean forceDeactivateSim,
+ in ISwitchToSubscriptionCallback callback);
+ void updateSubscriptionNickname(int slotId, String iccid, String nickname,
+ in IUpdateSubscriptionNicknameCallback callback);
+ void eraseSubscriptions(int slotId, in IEraseSubscriptionsCallback callback);
}
\ No newline at end of file
diff --git a/core/java/android/service/euicc/IGetDefaultDownloadableSubscriptionListCallback.aidl b/core/java/android/service/euicc/IGetDefaultDownloadableSubscriptionListCallback.aidl
new file mode 100644
index 0000000000000..0c5a0c692cb55
--- /dev/null
+++ b/core/java/android/service/euicc/IGetDefaultDownloadableSubscriptionListCallback.aidl
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.service.euicc;
+
+import android.service.euicc.GetDefaultDownloadableSubscriptionListResult;
+
+/** @hide */
+oneway interface IGetDefaultDownloadableSubscriptionListCallback {
+ void onComplete(in GetDefaultDownloadableSubscriptionListResult result);
+}
\ No newline at end of file
diff --git a/core/java/android/service/euicc/IGetEuiccInfoCallback.aidl b/core/java/android/service/euicc/IGetEuiccInfoCallback.aidl
new file mode 100644
index 0000000000000..6d281487602af
--- /dev/null
+++ b/core/java/android/service/euicc/IGetEuiccInfoCallback.aidl
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.service.euicc;
+
+import android.telephony.euicc.EuiccInfo;
+
+/** @hide */
+oneway interface IGetEuiccInfoCallback {
+ void onSuccess(in EuiccInfo euiccInfo);
+}
\ No newline at end of file
diff --git a/core/java/android/service/euicc/ISwitchToSubscriptionCallback.aidl b/core/java/android/service/euicc/ISwitchToSubscriptionCallback.aidl
new file mode 100644
index 0000000000000..970adcd8bef50
--- /dev/null
+++ b/core/java/android/service/euicc/ISwitchToSubscriptionCallback.aidl
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.service.euicc;
+
+import android.service.euicc.SwitchResult;
+
+/** @hide */
+oneway interface ISwitchToSubscriptionCallback {
+ void onComplete(in SwitchResult result);
+}
\ No newline at end of file
diff --git a/core/java/android/service/euicc/IUpdateSubscriptionNicknameCallback.aidl b/core/java/android/service/euicc/IUpdateSubscriptionNicknameCallback.aidl
new file mode 100644
index 0000000000000..439759d957476
--- /dev/null
+++ b/core/java/android/service/euicc/IUpdateSubscriptionNicknameCallback.aidl
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.service.euicc;
+
+import android.service.euicc.UpdateNicknameResult;
+
+/** @hide */
+oneway interface IUpdateSubscriptionNicknameCallback {
+ void onComplete(in UpdateNicknameResult result);
+}
\ No newline at end of file
diff --git a/core/java/android/service/euicc/SwitchResult.aidl b/core/java/android/service/euicc/SwitchResult.aidl
new file mode 100644
index 0000000000000..eb706a5c65d37
--- /dev/null
+++ b/core/java/android/service/euicc/SwitchResult.aidl
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.service.euicc;
+
+parcelable SwitchResult;
diff --git a/core/java/android/service/euicc/SwitchResult.java b/core/java/android/service/euicc/SwitchResult.java
new file mode 100644
index 0000000000000..f5dc4d3399c13
--- /dev/null
+++ b/core/java/android/service/euicc/SwitchResult.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.service.euicc;
+
+import android.annotation.IntDef;
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Result of a {@link EuiccService#onSwitchToSubscription} operation.
+ * @hide
+ *
+ * TODO(b/35851809): Make this a SystemApi.
+ */
+public final class SwitchResult implements Parcelable {
+
+ public static final Creator Requires the calling app to be authorized to manage both the currently-active subscription
- * and the subscription to be downloaded according to the subscription metadata. Without the
- * former, a {@link #EMBEDDED_SUBSCRIPTION_RESULT_RESOLVABLE_ERROR} will be returned in the
- * callback intent to prompt the user to accept the download.
+ * Requires the {@link android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS} permission,
+ * or the calling app must be authorized to manage both the currently-active subscription and
+ * the subscription to be downloaded according to the subscription metadata. Without the former,
+ * an {@link #EMBEDDED_SUBSCRIPTION_RESULT_RESOLVABLE_ERROR} will be returned in the callback
+ * intent to prompt the user to accept the download.
*
* @param subscription the subscription to download.
* @param switchAfterDownload if true, the profile will be activated upon successful download.
@@ -261,8 +271,9 @@ public class EuiccManager {
* For example, this may indicate whether the user has consented or may include the input
* they provided.
* @hide
+ *
+ * TODO(b/35851809): Make this a SystemApi.
*/
- @SystemApi
public void continueOperation(Intent resolutionIntent, Bundle resolutionExtras) {
if (!isEnabled()) {
PendingIntent callbackIntent =
@@ -299,7 +310,6 @@ public class EuiccManager {
*
* TODO(b/35851809): Make this a SystemApi.
*/
- @SystemApi
public void getDownloadableSubscriptionMetadata(
DownloadableSubscription subscription, PendingIntent callbackIntent) {
if (!isEnabled()) {
@@ -313,6 +323,153 @@ public class EuiccManager {
}
}
+ /**
+ * Gets metadata for subscription which are available for download on this device.
+ *
+ * Subscriptions returned here may be passed to {@link #downloadSubscription}. They may have
+ * been pre-assigned to this particular device, for example. The callback will be triggered with
+ * an Intent with {@link #EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTIONS} set to the
+ * list of available subscriptions upon success.
+ *
+ * Requires that the calling app has the
+ * {@link android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS} permission. This is for
+ * internal system use only.
+ *
+ * @param callbackIntent a PendingIntent to launch when the operation completes.
+ * @hide
+ *
+ * TODO(b/35851809): Make this a SystemApi.
+ */
+ public void getDefaultDownloadableSubscriptionList(PendingIntent callbackIntent) {
+ if (!isEnabled()) {
+ sendUnavailableError(callbackIntent);
+ return;
+ }
+ try {
+ mController.getDefaultDownloadableSubscriptionList(callbackIntent);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Returns information about the eUICC chip/device.
+ *
+ * @return the {@link EuiccInfo}. May be null if {@link #isEnabled()} is false or the eUICC is
+ * not ready.
+ */
+ @Nullable
+ public EuiccInfo getEuiccInfo() {
+ if (!isEnabled()) {
+ return null;
+ }
+ try {
+ return mController.getEuiccInfo();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Deletes the given subscription.
+ *
+ * If this subscription is currently active, the device will first switch away from it onto
+ * an "empty" subscription.
+ *
+ * Requires that the calling app has carrier privileges according to the metadata of the
+ * profile to be deleted, or the
+ * {@link android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS} permission.
+ *
+ * @param subscriptionId the ID of the subscription to delete.
+ * @param callbackIntent a PendingIntent to launch when the operation completes.
+ */
+ public void deleteSubscription(int subscriptionId, PendingIntent callbackIntent) {
+ if (!isEnabled()) {
+ sendUnavailableError(callbackIntent);
+ return;
+ }
+ try {
+ mController.deleteSubscription(
+ subscriptionId, mContext.getOpPackageName(), callbackIntent);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Switch to (enable) the given subscription.
+ *
+ * Requires the {@link android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS} permission,
+ * or the calling app must be authorized to manage both the currently-active subscription and
+ * the subscription to be enabled according to the subscription metadata. Without the former,
+ * an {@link #EMBEDDED_SUBSCRIPTION_RESULT_RESOLVABLE_ERROR} will be returned in the callback
+ * intent to prompt the user to accept the download.
+ *
+ * @param subscriptionId the ID of the subscription to enable. May be
+ * {@link android.telephony.SubscriptionManager#INVALID_SUBSCRIPTION_ID} to deactivate the
+ * current profile without activating another profile to replace it.
+ * @param callbackIntent a PendingIntent to launch when the operation completes.
+ */
+ public void switchToSubscription(int subscriptionId, PendingIntent callbackIntent) {
+ if (!isEnabled()) {
+ sendUnavailableError(callbackIntent);
+ return;
+ }
+ try {
+ mController.switchToSubscription(
+ subscriptionId, mContext.getOpPackageName(), callbackIntent);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Update the nickname for the given subscription.
+ *
+ * Requires that the calling app has the
+ * {@link android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS} permission. This is for
+ * internal system use only.
+ *
+ * @param subscriptionId the ID of the subscription to update.
+ * @param nickname the new nickname to apply.
+ * @param callbackIntent a PendingIntent to launch when the operation completes.
+ * @hide
+ */
+ public void updateSubscriptionNickname(
+ int subscriptionId, String nickname, PendingIntent callbackIntent) {
+ if (!isEnabled()) {
+ sendUnavailableError(callbackIntent);
+ return;
+ }
+ try {
+ mController.updateSubscriptionNickname(subscriptionId, nickname, callbackIntent);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Erase all subscriptions and reset the eUICC.
+ *
+ * Requires that the calling app has the
+ * {@link android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS} permission. This is for
+ * internal system use only.
+ *
+ * @param callbackIntent a PendingIntent to launch when the operation completes.
+ * @hide
+ */
+ public void eraseSubscriptions(PendingIntent callbackIntent) {
+ if (!isEnabled()) {
+ sendUnavailableError(callbackIntent);
+ return;
+ }
+ try {
+ mController.eraseSubscriptions(callbackIntent);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
private static void sendUnavailableError(PendingIntent callbackIntent) {
try {
callbackIntent.send(EMBEDDED_SUBSCRIPTION_RESULT_GENERIC_ERROR);
diff --git a/telephony/java/com/android/internal/telephony/euicc/IEuiccController.aidl b/telephony/java/com/android/internal/telephony/euicc/IEuiccController.aidl
index 5f03dd97d785e..725b89bcf3513 100644
--- a/telephony/java/com/android/internal/telephony/euicc/IEuiccController.aidl
+++ b/telephony/java/com/android/internal/telephony/euicc/IEuiccController.aidl
@@ -20,13 +20,23 @@ import android.app.PendingIntent;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.euicc.DownloadableSubscription;
+import android.telephony.euicc.EuiccInfo;
/** @hide */
interface IEuiccController {
oneway void continueOperation(in Intent resolutionIntent, in Bundle resolutionExtras);
oneway void getDownloadableSubscriptionMetadata(in DownloadableSubscription subscription,
in PendingIntent callbackIntent);
+ oneway void getDefaultDownloadableSubscriptionList(in PendingIntent callbackIntent);
String getEid();
oneway void downloadSubscription(in DownloadableSubscription subscription,
boolean switchAfterDownload, String callingPackage, in PendingIntent callbackIntent);
+ EuiccInfo getEuiccInfo();
+ oneway void deleteSubscription(int subscriptionId, String callingPackage,
+ in PendingIntent callbackIntent);
+ oneway void switchToSubscription(int subscriptionId, String callingPackage,
+ in PendingIntent callbackIntent);
+ oneway void updateSubscriptionNickname(int subscriptionId, String nickname,
+ in PendingIntent callbackIntent);
+ oneway void eraseSubscriptions(in PendingIntent callbackIntent);
}
\ No newline at end of file