Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91c3d07f authored by Jeff Davidson's avatar Jeff Davidson
Browse files

Implement remaining core eUICC APIs.

Includes:

-getDefaultDownloadableSubscriptionList, which returns a list of
default subscriptions available for the device.
-getEuiccInfo, which returns an EuiccInfo object containing
non-sensitive information about the eUICC device.
-deleteSubscription, to delete a subscription.
-switchToSubscription, to switch to (or away from) a subscription.
-updateSubscriptionNickname, to update the nickname of a subscription
which is saved to the eUICC.
-eraseSubscriptions, to factory reset the eUICC.
-Settings.Global#DEFAULT_SM_DP_PLUS, a default SM-DP+ server which is
used to query for default subscriptions in
getDefaultDownloadableSubscriptionList.

These APIs follow the template of the APIs which have already been
implemented.

This completes the baseline implementation as designed; any additional
APIs or tweaks to the APIs will be tracked as separate bugs.

Fixes: 33075886
Test: Build/boot
Change-Id: I8057757c874f94e0c816af1ca071d656c8f145b9
parent d02731ff
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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 \
+15 −0
Original line number Diff line number Diff line
@@ -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.
         *
         * <p>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.
+19 −0
Original line number Diff line number Diff line
/*
 * 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;
+97 −0
Original line number Diff line number Diff line
/*
 * 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<DeleteResult> CREATOR = new Creator<DeleteResult>() {
        @Override
        public DeleteResult createFromParcel(Parcel in) {
            return new DeleteResult(in);
        }

        @Override
        public DeleteResult[] newArray(int size) {
            return new DeleteResult[size];
        }
    };

    /** @hide */
    @IntDef({
            RESULT_OK,
            RESULT_GENERIC_ERROR,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface ResultCode {}

    public static final int RESULT_OK = 0;
    public static final int RESULT_GENERIC_ERROR = 1;

    /** Result of the operation - one of the RESULT_* constants. */
    public final @ResultCode int result;

    /** Implementation-defined detailed error code in case of a failure not covered here. */
    public final int detailedCode;

    private DeleteResult(int result, int detailedCode) {
        this.result = result;
        this.detailedCode = detailedCode;
    }

    private DeleteResult(Parcel in) {
        this.result = in.readInt();
        this.detailedCode = in.readInt();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(result);
        dest.writeInt(detailedCode);
    }

    /** Return a result indicating that the delete was successful. */
    public static DeleteResult success() {
        return new DeleteResult(RESULT_OK, 0);
    }

    /**
     * Return a result indicating that an error occurred for which no other more specific error
     * code has been defined.
     *
     * @param detailedCode an implemenation-defined detailed error code for debugging purposes.
     */
    public static DeleteResult genericError(int detailedCode) {
        return new DeleteResult(RESULT_GENERIC_ERROR, detailedCode);
    }

    @Override
    public int describeContents() {
        return 0;
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Result of a {@link EuiccService#downloadSubscription} operation.
 * Result of a {@link EuiccService#onDownloadSubscription} operation.
 * @hide
 *
 * TODO(b/35851809): Make this a SystemApi.
Loading