diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 59d8ad0..adac9d0 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,9 +1,8 @@ - + - \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index d051337..c7920ab 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -13,7 +13,6 @@ diff --git a/.idea/misc.xml b/.idea/misc.xml index fee0503..0e4c1b7 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -17,7 +17,7 @@ - + diff --git a/app/build.gradle b/app/build.gradle index bf861c2..996e927 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -36,7 +36,6 @@ android { } dependencies { - compileOnly project(":libs:hidden-apis") implementation project(":libs:lpad-sm-dp-plus-connector") implementation 'androidx.core:core-ktx:1.7.0' implementation 'androidx.appcompat:appcompat:1.4.1' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 20063be..f1e4c8d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -29,15 +29,6 @@ - - - - - - diff --git a/app/src/main/java/im/angry/openeuicc/OpenEuiccApplication.kt b/app/src/main/java/im/angry/openeuicc/OpenEuiccApplication.kt index dacdd7d..30e021a 100644 --- a/app/src/main/java/im/angry/openeuicc/OpenEuiccApplication.kt +++ b/app/src/main/java/im/angry/openeuicc/OpenEuiccApplication.kt @@ -3,8 +3,6 @@ package im.angry.openeuicc import android.app.Application import android.telephony.TelephonyManager import im.angry.openeuicc.core.EuiccChannelManager -import im.angry.openeuicc.util.* -import java.lang.Exception class OpenEuiccApplication : Application() { val telephonyManager by lazy { @@ -14,19 +12,4 @@ class OpenEuiccApplication : Application() { val euiccChannelManager by lazy { EuiccChannelManager(this) } - - override fun onCreate() { - super.onCreate() - // Clean up channels left open in TelephonyManager - // due to a (potentially) forced restart - for (slotId in 0 until EuiccChannelManager.MAX_SIMS) { - for (channel in 0 until 10) { - try { - telephonyManager.iccCloseLogicalChannelBySlot(slotId, channel) - } catch (_: Exception) { - // We do not care - } - } - } - } } \ No newline at end of file diff --git a/app/src/main/java/im/angry/openeuicc/core/TelephonyManagerApduChannel.kt b/app/src/main/java/im/angry/openeuicc/core/TelephonyManagerApduChannel.kt index f7b315b..3b4f217 100644 --- a/app/src/main/java/im/angry/openeuicc/core/TelephonyManagerApduChannel.kt +++ b/app/src/main/java/im/angry/openeuicc/core/TelephonyManagerApduChannel.kt @@ -1,13 +1,14 @@ package im.angry.openeuicc.core +import android.telephony.IccOpenLogicalChannelResponse import android.telephony.IccOpenLogicalChannelResponse.INVALID_CHANNEL import android.telephony.IccOpenLogicalChannelResponse.STATUS_NO_ERROR import android.telephony.TelephonyManager import android.util.Log import com.truphone.lpa.ApduChannel import com.truphone.lpa.ApduTransmittedListener -import im.angry.openeuicc.util.* import java.lang.Exception +import java.lang.reflect.Method class TelephonyManagerApduChannel( private val tm: TelephonyManager, @@ -18,23 +19,32 @@ class TelephonyManagerApduChannel( private const val TAG = "TelephonyManagerApduChannel" private const val EUICC_APP_ID = "A0000005591010FFFFFFFF8900000100" + private val iccOpenLogicalChannelBySlot: Method = + TelephonyManager::class.java.getMethod("iccOpenLogicalChannelBySlot", + Int::class.java, String::class.java, Int::class.java) + private val iccCloseLogicalChannelBySlot: Method = + TelephonyManager::class.java.getMethod("iccCloseLogicalChannelBySlot", + Int::class.java, Int::class.java) + private val iccTransmitApduLogicalChannelBySlot: Method = + TelephonyManager::class.java.getMethod("iccTransmitApduLogicalChannelBySlot", + Int::class.java, Int::class.java, Int::class.java, Int::class.java, + Int::class.java, Int::class.java, Int::class.java, String::class.java) + // TODO: On Tiramisu, we need to specify the portId also if we want MEP support fun tryConnectUiccSlot(tm: TelephonyManager, slotId: Int): Pair? { try { - val channel = tm.iccOpenLogicalChannelBySlot(slotId, EUICC_APP_ID, 0) + val channel = iccOpenLogicalChannelBySlot.invoke(tm, slotId, EUICC_APP_ID, 0) as IccOpenLogicalChannelResponse if (channel.status != STATUS_NO_ERROR || channel.channel == INVALID_CHANNEL) { - Log.e(TAG, "Unable to open eUICC channel for slot ${slotId} via TelephonyManager: ${channel.status}") + Log.e(TAG, "Unable to open eUICC channel for slot ${slotId} via TelephonyManager") return null } - Log.d(TAG, "channel: ${channel.channel}") - val stateManager = object : EuiccChannelStateManager { override val valid: Boolean get() = true // TODO: Fix this properly override fun destroy() { - tm.iccCloseLogicalChannelBySlot(slotId, channel.channel) + iccCloseLogicalChannelBySlot.invoke(tm, slotId, channel.channel) } } @@ -48,7 +58,7 @@ class TelephonyManagerApduChannel( } } - override fun transmitAPDU(apdu: String): String? { + override fun transmitAPDU(apdu: String): String { val cla = Integer.parseInt(apdu.substring(0, 2), 16) val instruction = Integer.parseInt(apdu.substring(2, 4), 16) val p1 = Integer.parseInt(apdu.substring(4, 6), 16) @@ -56,13 +66,13 @@ class TelephonyManagerApduChannel( val p3 = Integer.parseInt(apdu.substring(8, 10), 16) val p4 = apdu.substring(10) - return tm.iccTransmitApduLogicalChannelBySlot( - slotId, channelId, - cla, instruction, p1, p2, p3, p4) + return iccTransmitApduLogicalChannelBySlot.invoke( + tm, slotId, channelId, + cla, instruction, p1, p2, p3, p4) as String } - override fun transmitAPDUS(apdus: MutableList): String? { - var res: String? = "" + override fun transmitAPDUS(apdus: MutableList): String { + var res = "" for (pdu in apdus) { res = transmitAPDU(pdu) } diff --git a/app/src/main/java/im/angry/openeuicc/service/OpenEuiccService.kt b/app/src/main/java/im/angry/openeuicc/service/OpenEuiccService.kt deleted file mode 100644 index 3e4d77d..0000000 --- a/app/src/main/java/im/angry/openeuicc/service/OpenEuiccService.kt +++ /dev/null @@ -1,106 +0,0 @@ -package im.angry.openeuicc.service - -import android.service.euicc.* -import android.telephony.euicc.DownloadableSubscription -import android.telephony.euicc.EuiccInfo -import com.truphone.lpa.LocalProfileAssistant -import com.truphone.lpa.LocalProfileInfo -import im.angry.openeuicc.OpenEuiccApplication - -class OpenEuiccService : EuiccService() { - private fun findLpa(slotId: Int): LocalProfileAssistant? = - (application as OpenEuiccApplication).euiccChannelManager - .findEuiccChannelBySlotBlocking(slotId)?.lpa - - override fun onGetEid(slotId: Int): String? = - findLpa(slotId)?.eid - - override fun onGetOtaStatus(slotId: Int): Int { - // Not implemented - return 5 // EUICC_OTA_STATUS_UNAVAILABLE - } - - override fun onStartOtaIfNecessary( - slotId: Int, - statusChangedCallback: OtaStatusChangedCallback? - ) { - // Not implemented - } - - override fun onGetDownloadableSubscriptionMetadata( - slotId: Int, - subscription: DownloadableSubscription?, - forceDeactivateSim: Boolean - ): GetDownloadableSubscriptionMetadataResult { - // Stub: return as-is and do not fetch anything - // This is incompatible with carrier eSIM apps; should we make it compatible? - return GetDownloadableSubscriptionMetadataResult(RESULT_OK, subscription) - } - - override fun onGetDefaultDownloadableSubscriptionList( - slotId: Int, - forceDeactivateSim: Boolean - ): GetDefaultDownloadableSubscriptionListResult { - // Stub: we do not implement this (as this would require phoning in a central GSMA server) - return GetDefaultDownloadableSubscriptionListResult(RESULT_OK, arrayOf()) - } - - override fun onGetEuiccProfileInfoList(slotId: Int): GetEuiccProfileInfoListResult? { - val profiles = (findLpa(slotId) ?: return null).profiles.filter { - it.profileClass != LocalProfileInfo.Clazz.Testing - }.map { - EuiccProfileInfo.Builder(it.iccidLittleEndian).apply { - setProfileName(it.name) - setNickname(it.nickName) - setServiceProviderName(it.providerName) - setState( - when (it.state) { - LocalProfileInfo.State.Enabled -> EuiccProfileInfo.PROFILE_STATE_ENABLED - LocalProfileInfo.State.Disabled -> EuiccProfileInfo.PROFILE_STATE_DISABLED - } - ) - setProfileClass( - when (it.profileClass) { - LocalProfileInfo.Clazz.Testing -> EuiccProfileInfo.PROFILE_CLASS_TESTING - LocalProfileInfo.Clazz.Provisioning -> EuiccProfileInfo.PROFILE_CLASS_PROVISIONING - LocalProfileInfo.Clazz.Operational -> EuiccProfileInfo.PROFILE_CLASS_OPERATIONAL - } - ) - }.build() - } - - return GetEuiccProfileInfoListResult(RESULT_OK, profiles.toTypedArray(), false) - } - - override fun onGetEuiccInfo(slotId: Int): EuiccInfo { - return EuiccInfo("Unknown") // TODO: Can we actually implement this? - } - - override fun onDeleteSubscription(slotId: Int, iccid: String?): Int { - TODO("Not yet implemented") - } - - @Deprecated("Deprecated in Java") - override fun onSwitchToSubscription( - slotId: Int, - iccid: String?, - forceDeactivateSim: Boolean - ): Int { - TODO("Not yet implemented") - } - - override fun onUpdateSubscriptionNickname(slotId: Int, iccid: String?, nickname: String?): Int { - TODO("Not yet implemented") - } - - @Deprecated("Deprecated in Java") - override fun onEraseSubscriptions(slotId: Int): Int { - // No-op - return RESULT_FIRST_USER - } - - override fun onRetainSubscriptionsForFactoryReset(slotId: Int): Int { - // No-op -- we do not care - return RESULT_FIRST_USER - } -} \ No newline at end of file diff --git a/app/src/main/java/im/angry/openeuicc/util/TelephonyUtils.kt b/app/src/main/java/im/angry/openeuicc/util/TelephonyUtils.kt index b655f10..a1ae2d1 100644 --- a/app/src/main/java/im/angry/openeuicc/util/TelephonyUtils.kt +++ b/app/src/main/java/im/angry/openeuicc/util/TelephonyUtils.kt @@ -1,8 +1,6 @@ package im.angry.openeuicc.util -import android.telephony.IccOpenLogicalChannelResponse import android.telephony.TelephonyManager -import java.lang.reflect.Method val TelephonyManager.supportsDSDS: Boolean get() = supportedModemCount == 2 @@ -11,41 +9,4 @@ var TelephonyManager.dsdsEnabled: Boolean get() = activeModemCount >= 2 set(value) { switchMultiSimConfig(if (value) { 2 } else {1}) - } - -// Hidden APIs via reflection to enable building without AOSP source tree -private val iccOpenLogicalChannelBySlot: Method by lazy { - TelephonyManager::class.java.getMethod( - "iccOpenLogicalChannelBySlot", - Int::class.java, String::class.java, Int::class.java - ) -} -private val iccCloseLogicalChannelBySlot: Method by lazy { - TelephonyManager::class.java.getMethod( - "iccCloseLogicalChannelBySlot", - Int::class.java, Int::class.java - ) -} -private val iccTransmitApduLogicalChannelBySlot: Method by lazy { - TelephonyManager::class.java.getMethod( - "iccTransmitApduLogicalChannelBySlot", - Int::class.java, Int::class.java, Int::class.java, Int::class.java, - Int::class.java, Int::class.java, Int::class.java, String::class.java - ) -} - -fun TelephonyManager.iccOpenLogicalChannelBySlot( - slotId: Int, appletId: String, p2: Int -): IccOpenLogicalChannelResponse = - iccOpenLogicalChannelBySlot.invoke(this, slotId, appletId, p2) as IccOpenLogicalChannelResponse - -fun TelephonyManager.iccCloseLogicalChannelBySlot(slotId: Int, channel: Int): Boolean = - iccCloseLogicalChannelBySlot.invoke(this, slotId, channel) as Boolean - -fun TelephonyManager.iccTransmitApduLogicalChannelBySlot( - slotId: Int, channel: Int, cla: Int, instruction: Int, - p1: Int, p2: Int, p3: Int, data: String? -): String? = - iccTransmitApduLogicalChannelBySlot.invoke( - this, slotId, channel, cla, instruction, p1, p2, p3, data - ) as String? \ No newline at end of file + } \ No newline at end of file diff --git a/libs/hidden-apis/.gitignore b/libs/hidden-apis/.gitignore deleted file mode 100644 index 42afabf..0000000 --- a/libs/hidden-apis/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/libs/hidden-apis/build.gradle b/libs/hidden-apis/build.gradle deleted file mode 100644 index 99f242a..0000000 --- a/libs/hidden-apis/build.gradle +++ /dev/null @@ -1,16 +0,0 @@ -plugins { - id 'com.android.library' -} - -android { - compileSdk 31 -} - -java { - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 -} - -dependencies { - implementation 'org.jetbrains:annotations:15.0' -} \ No newline at end of file diff --git a/libs/hidden-apis/src/main/AndroidManifest.xml b/libs/hidden-apis/src/main/AndroidManifest.xml deleted file mode 100644 index 38867cc..0000000 --- a/libs/hidden-apis/src/main/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/libs/hidden-apis/src/main/java/android/service/euicc/DownloadSubscriptionResult.java b/libs/hidden-apis/src/main/java/android/service/euicc/DownloadSubscriptionResult.java deleted file mode 100644 index 42b0d03..0000000 --- a/libs/hidden-apis/src/main/java/android/service/euicc/DownloadSubscriptionResult.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2018 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.os.Parcel; -import android.os.Parcelable; -/** - * @hide - */ -public final class DownloadSubscriptionResult implements Parcelable { - public static final Creator CREATOR = - new Creator() { - @Override - public DownloadSubscriptionResult createFromParcel(Parcel in) { - return new DownloadSubscriptionResult(in); - } - @Override - public DownloadSubscriptionResult[] newArray(int size) { - return new DownloadSubscriptionResult[size]; - } - }; - - public DownloadSubscriptionResult(int result, int resolvableErrors, - int cardId) { - - } - /** Gets the result of the operation. */ - public int getResult() { - return 0; - } - /** - * Gets the bit map of resolvable errors. - */ - public int getResolvableErrors() { - return 0; - } - /** - * Gets the card Id. This is used when resolving resolvable errors. The value is passed from - * EuiccService. - */ - public int getCardId() { - return 0; - } - @Override - public void writeToParcel(Parcel dest, int flags) { - - } - @Override - public int describeContents() { - return 0; - } - private DownloadSubscriptionResult(Parcel in) { - } -} \ No newline at end of file diff --git a/libs/hidden-apis/src/main/java/android/service/euicc/EuiccProfileInfo.java b/libs/hidden-apis/src/main/java/android/service/euicc/EuiccProfileInfo.java deleted file mode 100644 index dbfcb20..0000000 --- a/libs/hidden-apis/src/main/java/android/service/euicc/EuiccProfileInfo.java +++ /dev/null @@ -1,211 +0,0 @@ -/* - * 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.os.Parcel; -import android.os.Parcelable; -import android.service.carrier.CarrierIdentifier; -import android.telephony.UiccAccessRule; -import java.util.List; - -/** - * Information about an embedded profile (subscription) on an eUICC. - * - * @hide - */ -public final class EuiccProfileInfo implements Parcelable { - /** Profile policy rules (bit mask) */ - /** Once this profile is enabled, it cannot be disabled. */ - public static final int POLICY_RULE_DO_NOT_DISABLE = 1; - /** This profile cannot be deleted. */ - public static final int POLICY_RULE_DO_NOT_DELETE = 1 << 1; - /** This profile should be deleted after being disabled. */ - public static final int POLICY_RULE_DELETE_AFTER_DISABLING = 1 << 2; - /** Class of the profile */ - /** Testing profiles */ - public static final int PROFILE_CLASS_TESTING = 0; - /** Provisioning profiles which are pre-loaded on eUICC */ - public static final int PROFILE_CLASS_PROVISIONING = 1; - /** Operational profiles which can be pre-loaded or downloaded */ - public static final int PROFILE_CLASS_OPERATIONAL = 2; - /** - * Profile class not set. - * @hide - */ - public static final int PROFILE_CLASS_UNSET = -1; - /** State of the profile */ - /** Disabled profiles */ - public static final int PROFILE_STATE_DISABLED = 0; - /** Enabled profile */ - public static final int PROFILE_STATE_ENABLED = 1; - /** - * Profile state not set. - * @hide - */ - public static final int PROFILE_STATE_UNSET = -1; - - public static final Creator CREATOR = new Creator() { - @Override - public EuiccProfileInfo createFromParcel(Parcel in) { - return new EuiccProfileInfo(in); - } - @Override - public EuiccProfileInfo[] newArray(int size) { - return new EuiccProfileInfo[size]; - } - }; - // TODO(b/70292228): Remove this method when LPA can be updated. - /** - * @hide - * @deprecated - Do not use. - */ - @Deprecated - public EuiccProfileInfo(String iccid, UiccAccessRule[] accessRules, - String nickname) { - - } - - private EuiccProfileInfo(Parcel in) { - - } - - @Override - public void writeToParcel(Parcel dest, int flags) { - - } - @Override - public int describeContents() { - return 0; - } - /** The builder to build a new {@link EuiccProfileInfo} instance. */ - public static final class Builder { - - public Builder(String value) { - - } - public Builder(EuiccProfileInfo baseProfile) { - - } - /** Builds the profile instance. */ - public EuiccProfileInfo build() { - return null; - } - /** Sets the iccId of the subscription. */ - public Builder setIccid(String value) { - return this; - } - /** Sets the nickname of the subscription. */ - public Builder setNickname(String value) { - return this; - } - /** Sets the service provider name of the subscription. */ - public Builder setServiceProviderName(String value) { - return this; - } - /** Sets the profile name of the subscription. */ - public Builder setProfileName(String value) { - return this; - } - /** Sets the profile class of the subscription. */ - public Builder setProfileClass(int value) { - return this; - } - /** Sets the state of the subscription. */ - public Builder setState(int value) { - return this; - } - /** Sets the carrier identifier of the subscription. */ - public Builder setCarrierIdentifier(CarrierIdentifier value) { - return this; - } - /** Sets the policy rules of the subscription. */ - public Builder setPolicyRules(int value) { - return this; - } - /** Sets the access rules of the subscription. */ - public Builder setUiccAccessRule(List value) { - return this; - } - } - private EuiccProfileInfo( - String iccid, - String nickname, - String serviceProviderName, - String profileName, - int profileClass, - int state, - CarrierIdentifier carrierIdentifier, - int policyRules, - List accessRules) { - - } - /** Gets the ICCID string. */ - public String getIccid() { - return null; - } - /** Gets the access rules. */ - public List getUiccAccessRules() { - return null; - } - /** Gets the nickname. */ - public String getNickname() { - return null; - } - /** Gets the service provider name. */ - public String getServiceProviderName() { - return null; - } - /** Gets the profile name. */ - public String getProfileName() { - return null; - } - /** Gets the profile class. */ - public int getProfileClass() { - return 0; - } - /** Gets the state of the subscription. */ - public int getState() { - return 0; - } - /** Gets the carrier identifier. */ - public CarrierIdentifier getCarrierIdentifier() { - return null; - } - /** Gets the policy rules. */ - public int getPolicyRules() { - return 0; - } - /** Returns whether any policy rule exists. */ - public boolean hasPolicyRules() { - return false; - } - /** Checks whether a certain policy rule exists. */ - public boolean hasPolicyRule(int policy) { - return false; - } - @Override - public boolean equals(Object obj) { - return false; - } - @Override - public int hashCode() { - int result = 1; - return result; - } - @Override - public String toString() { - return null; - } -} \ No newline at end of file diff --git a/libs/hidden-apis/src/main/java/android/service/euicc/EuiccService.java b/libs/hidden-apis/src/main/java/android/service/euicc/EuiccService.java deleted file mode 100644 index a1cd43b..0000000 --- a/libs/hidden-apis/src/main/java/android/service/euicc/EuiccService.java +++ /dev/null @@ -1,465 +0,0 @@ -/* - * 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.app.Service; -import android.content.Intent; -import android.os.Bundle; -import android.os.IBinder; -import android.telephony.euicc.DownloadableSubscription; -import android.telephony.euicc.EuiccInfo; -import java.io.PrintWriter; - -/** - * Service interface linking the system with an eUICC local profile assistant (LPA) application. - * - *

An LPA consists of two separate components (which may both be implemented in the same APK): - * the LPA backend, and the LPA UI or LUI. - * - * @hide - */ -public abstract class EuiccService extends Service { - /** Action which must be included in this service's intent filter. */ - public static final String EUICC_SERVICE_INTERFACE = "android.service.euicc.EuiccService"; - /** Category which must be defined to all UI actions, for efficient lookup. */ - public static final String CATEGORY_EUICC_UI = "android.service.euicc.category.EUICC_UI"; - // LUI actions. These are passthroughs of the corresponding EuiccManager actions. - /** - * Action used to bind the carrier app and get the activation code from the carrier app. This - * activation code will be used to download the eSIM profile during eSIM activation flow. - */ - public static final String ACTION_BIND_CARRIER_PROVISIONING_SERVICE = - "android.service.euicc.action.BIND_CARRIER_PROVISIONING_SERVICE"; - /** - * Intent action sent by the LPA to launch a carrier app Activity for eSIM activation, e.g. a - * carrier login screen. Carrier apps wishing to support this activation method must implement - * an Activity that responds to this intent action. Upon completion, the Activity must return - * one of the following results to the LPA: - * - *

{@code Activity.RESULT_CANCELED}: The LPA should treat this as an back button and abort - * the activation flow. - *

{@code Activity.RESULT_OK}: The LPA should try to get an activation code from the carrier - * app by binding to the carrier app service implementing - * {@link #ACTION_BIND_CARRIER_PROVISIONING_SERVICE}. - *

{@code Activity.RESULT_OK} with - * {@link android.telephony.euicc.EuiccManager#EXTRA_USE_QR_SCANNER} set to true: The LPA should - * start a QR scanner for the user to scan an eSIM profile QR code. - *

For other results: The LPA should treat this as an error. - **/ - public static final String ACTION_START_CARRIER_ACTIVATION = - "android.service.euicc.action.START_CARRIER_ACTIVATION"; - /** - * @see android.telephony.euicc.EuiccManager#ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS - * The difference is this one is used by system to bring up the LUI. - */ - public static final String ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS = - "android.service.euicc.action.MANAGE_EMBEDDED_SUBSCRIPTIONS"; - public static final String ACTION_PROVISION_EMBEDDED_SUBSCRIPTION = - "android.service.euicc.action.PROVISION_EMBEDDED_SUBSCRIPTION"; - public static final String ACTION_TOGGLE_SUBSCRIPTION_PRIVILEGED = - "android.service.euicc.action.TOGGLE_SUBSCRIPTION_PRIVILEGED"; - public static final String ACTION_DELETE_SUBSCRIPTION_PRIVILEGED = - "android.service.euicc.action.DELETE_SUBSCRIPTION_PRIVILEGED"; - public static final String ACTION_RENAME_SUBSCRIPTION_PRIVILEGED = - "android.service.euicc.action.RENAME_SUBSCRIPTION_PRIVILEGED"; - public static final String ACTION_START_EUICC_ACTIVATION = - "android.service.euicc.action.START_EUICC_ACTIVATION"; - // LUI resolution actions. These are called by the platform to resolve errors in situations that - // require user interaction. - // TODO(b/33075886): Define extras for any input parameters to these dialogs once they are - // more scoped out. - /** - * Alert the user that this action will result in an active SIM being deactivated. - * To implement the LUI triggered by the system, you need to define this in AndroidManifest.xml. - */ - public static final String ACTION_RESOLVE_DEACTIVATE_SIM = - "android.service.euicc.action.RESOLVE_DEACTIVATE_SIM"; - /** - * Alert the user about a download/switch being done for an app that doesn't currently have - * carrier privileges. - */ - public static final String ACTION_RESOLVE_NO_PRIVILEGES = - "android.service.euicc.action.RESOLVE_NO_PRIVILEGES"; - /** - * Ask the user to input carrier confirmation code. - * - * @deprecated From Q, the resolvable errors happened in the download step are presented as - * bit map in {@link #EXTRA_RESOLVABLE_ERRORS}. The corresponding action would be - * {@link #ACTION_RESOLVE_RESOLVABLE_ERRORS}. - */ - @Deprecated - public static final String ACTION_RESOLVE_CONFIRMATION_CODE = - "android.service.euicc.action.RESOLVE_CONFIRMATION_CODE"; - /** Ask the user to resolve all the resolvable errors. */ - public static final String ACTION_RESOLVE_RESOLVABLE_ERRORS = - "android.service.euicc.action.RESOLVE_RESOLVABLE_ERRORS"; - /** - * Possible value for the bit map of resolvable errors indicating the download process needs - * the user to input confirmation code. - */ - public static final int RESOLVABLE_ERROR_CONFIRMATION_CODE = 1 << 0; - /** - * Possible value for the bit map of resolvable errors indicating the download process needs - * the user's consent to allow profile policy rules. - */ - public static final int RESOLVABLE_ERROR_POLICY_RULES = 1 << 1; - /** - * Intent extra set for resolution requests containing the package name of the calling app. - * This is used by the above actions including ACTION_RESOLVE_DEACTIVATE_SIM, - * ACTION_RESOLVE_NO_PRIVILEGES and ACTION_RESOLVE_RESOLVABLE_ERRORS. - */ - public static final String EXTRA_RESOLUTION_CALLING_PACKAGE = - "android.service.euicc.extra.RESOLUTION_CALLING_PACKAGE"; - /** - * Intent extra set for resolution requests containing the list of resolvable errors to be - * resolved. Each resolvable error is an integer. Its possible values include: - *

    - *
  • {@link #RESOLVABLE_ERROR_CONFIRMATION_CODE} - *
  • {@link #RESOLVABLE_ERROR_POLICY_RULES} - *
- */ - public static final String EXTRA_RESOLVABLE_ERRORS = - "android.service.euicc.extra.RESOLVABLE_ERRORS"; - /** - * Intent extra set for resolution requests containing a boolean indicating whether to ask the - * user to retry another confirmation code. - */ - public static final String EXTRA_RESOLUTION_CONFIRMATION_CODE_RETRIED = - "android.service.euicc.extra.RESOLUTION_CONFIRMATION_CODE_RETRIED"; - /** - * Intent extra set for resolution requests containing an int indicating the current card Id. - */ - public static final String EXTRA_RESOLUTION_CARD_ID = - "android.service.euicc.extra.RESOLUTION_CARD_ID"; - /** - * Intent extra set for resolution requests containing an int indicating the current port index. - */ - public static final String EXTRA_RESOLUTION_PORT_INDEX = - "android.service.euicc.extra.RESOLUTION_PORT_INDEX"; - /** - * Intent extra set for resolution requests containing a bool indicating whether to use the - * given port index. - */ - public static final String EXTRA_RESOLUTION_USE_PORT_INDEX = - "android.service.euicc.extra.RESOLUTION_USE_PORT_INDEX"; - /** Result code for a successful operation. */ - public static final int RESULT_OK = 0; - /** Result code indicating that an active SIM must be deactivated to perform the operation. */ - public static final int RESULT_MUST_DEACTIVATE_SIM = -1; - /** Result code indicating that the user must resolve resolvable errors. */ - public static final int RESULT_RESOLVABLE_ERRORS = -2; - /** - * Result code indicating that the user must input a carrier confirmation code. - * - * @deprecated From Q, the resolvable errors happened in the download step are presented as - * bit map in {@link #EXTRA_RESOLVABLE_ERRORS}. The corresponding result would be - * {@link #RESULT_RESOLVABLE_ERRORS}. - */ - @Deprecated - public static final int RESULT_NEED_CONFIRMATION_CODE = -2; - // New predefined codes should have negative values. - /** Start of implementation-specific error results. */ - public static final int RESULT_FIRST_USER = 1; - /** - * Boolean extra for resolution actions indicating whether the user granted consent. - * This is used and set by the implementation and used in {@code EuiccOperation}. - */ - public static final String EXTRA_RESOLUTION_CONSENT = - "android.service.euicc.extra.RESOLUTION_CONSENT"; - /** - * String extra for resolution actions indicating the carrier confirmation code. - * This is used and set by the implementation and used in {@code EuiccOperation}. - */ - public static final String EXTRA_RESOLUTION_CONFIRMATION_CODE = - "android.service.euicc.extra.RESOLUTION_CONFIRMATION_CODE"; - /** - * String extra for resolution actions indicating whether the user allows policy rules. - * This is used and set by the implementation and used in {@code EuiccOperation}. - */ - public static final String EXTRA_RESOLUTION_ALLOW_POLICY_RULES = - "android.service.euicc.extra.RESOLUTION_ALLOW_POLICY_RULES"; - - public EuiccService() { - } - /** - * Given a SubjectCode[5.2.6.1] and ReasonCode[5.2.6.2] from GSMA (SGP.22 v2.2), encode it to - * the format described in - * {@link android.telephony.euicc.EuiccManager#OPERATION_SMDX_SUBJECT_REASON_CODE} - * - * @param subjectCode SubjectCode[5.2.6.1] from GSMA (SGP.22 v2.2) - * @param reasonCode ReasonCode[5.2.6.2] from GSMA (SGP.22 v2.2) - * @return encoded error code described in - * {@link android.telephony.euicc.EuiccManager#OPERATION_SMDX_SUBJECT_REASON_CODE} - * @throws NumberFormatException when the Subject/Reason code contains non digits - * @throws IllegalArgumentException when Subject/Reason code is null/empty - * @throws UnsupportedOperationException when sections has more than four layers (e.g 5.8.1.2) - * or when an number is bigger than 15 - */ - public int encodeSmdxSubjectAndReasonCode(String subjectCode, - String reasonCode) { - return 0; - } - @Override - public void onCreate() { - super.onCreate(); - } - @Override - public void onDestroy() { - super.onDestroy(); - } - /** - * If overriding this method, call through to the super method for any unknown actions. - * {@inheritDoc} - */ - @Override - public IBinder onBind(Intent intent) { - return null; - } - /** - * Callback class for {@link #onStartOtaIfNecessary(int, OtaStatusChangedCallback)} - * - * The status of OTA which can be {@code android.telephony.euicc.EuiccManager#EUICC_OTA_} - */ - public abstract static class OtaStatusChangedCallback { - /** Called when OTA status is changed. */ - public abstract void onOtaStatusChanged(int status); - } - /** - * Return the EID of the eUICC. - * - * @param slotId ID of the SIM slot being queried. - * @return the EID. - * @see android.telephony.euicc.EuiccManager#getEid - */ - // TODO(b/36260308): Update doc when we have multi-SIM support. - public abstract String onGetEid(int slotId); - /** - * Return the status of OTA update. - * - * @param slotId ID of the SIM slot to use for the operation. - * @return The status of Euicc OTA update. - */ - public abstract int onGetOtaStatus(int slotId); - /** - * Perform OTA if current OS is not the latest one. - * - * @param slotId ID of the SIM slot to use for the operation. - * @param statusChangedCallback Function called when OTA status changed. - */ - public abstract void onStartOtaIfNecessary( - int slotId, OtaStatusChangedCallback statusChangedCallback); - /** - * Populate {@link DownloadableSubscription} metadata for the given downloadable subscription. - * - * @param slotId ID of the SIM slot to use for the operation. - * @param subscription A subscription whose metadata needs to be populated. - * @param forceDeactivateSim If true, and if an active SIM must be deactivated to access the - * eUICC, perform this action automatically. Otherwise, {@link #RESULT_MUST_DEACTIVATE_SIM)} - * should be returned to allow the user to consent to this operation first. - * @return The result of the operation. - */ - public abstract GetDownloadableSubscriptionMetadataResult onGetDownloadableSubscriptionMetadata( - int slotId, DownloadableSubscription subscription, boolean forceDeactivateSim); - /** - * Return metadata for subscriptions which are available for download for this device. - * - * @param slotId ID of the SIM slot to use for the operation. - * @param forceDeactivateSim If true, and if an active SIM must be deactivated to access the - * eUICC, perform this action automatically. Otherwise, {@link #RESULT_MUST_DEACTIVATE_SIM)} - * should be returned to allow the user to consent to this operation first. - * @return The result of the list operation. - */ - public abstract GetDefaultDownloadableSubscriptionListResult - onGetDefaultDownloadableSubscriptionList(int slotId, boolean forceDeactivateSim); - /** - * Download the given subscription. - * - * @param slotId ID of the SIM slot to use for the operation. - * @param subscription The subscription to download. - * @param switchAfterDownload If true, the subscription should be enabled upon successful - * download. - * @param forceDeactivateSim If true, and if an active SIM must be deactivated to access the - * eUICC, perform this action automatically. Otherwise, {@link #RESULT_MUST_DEACTIVATE_SIM} - * should be returned to allow the user to consent to this operation first. - * @param resolvedBundle The bundle containing information on resolved errors. It can contain - * a string of confirmation code for the key {@link #EXTRA_RESOLUTION_CONFIRMATION_CODE}, - * and a boolean for key {@link #EXTRA_RESOLUTION_ALLOW_POLICY_RULES} indicating whether - * the user allows profile policy rules or not. - * @return a DownloadSubscriptionResult instance including a result code, a resolvable errors - * bit map, and original the card Id. The result code may be one of the predefined - * {@code RESULT_} constants or any implementation-specific code starting with - * {@link #RESULT_FIRST_USER}. The resolvable error bit map can be either 0 or values - * defined in {@code RESOLVABLE_ERROR_}. A subclass should override this method. Otherwise, - * this method does nothing and returns null by default. - * @see android.telephony.euicc.EuiccManager#downloadSubscription - */ - public DownloadSubscriptionResult onDownloadSubscription(int slotId, - DownloadableSubscription subscription, boolean switchAfterDownload, - boolean forceDeactivateSim, Bundle resolvedBundle) { - return null; - } - /** - * Download the given subscription. - * - * @param slotId ID of the SIM slot to use for the operation. - * @param subscription The subscription to download. - * @param switchAfterDownload If true, the subscription should be enabled upon successful - * download. - * @param forceDeactivateSim If true, and if an active SIM must be deactivated to access the - * eUICC, perform this action automatically. Otherwise, {@link #RESULT_MUST_DEACTIVATE_SIM} - * should be returned to allow the user to consent to this operation first. - * @return the result of the download operation. May be one of the predefined {@code RESULT_} - * constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}. - * @see android.telephony.euicc.EuiccManager#downloadSubscription - * - * @deprecated From Q, a subclass should use and override the above - * {@link #onDownloadSubscription(int, DownloadableSubscription, boolean, boolean, Bundle)}. The - * default return value for this one is Integer.MIN_VALUE. - */ - @Deprecated public int onDownloadSubscription(int slotId, - DownloadableSubscription subscription, boolean switchAfterDownload, - boolean forceDeactivateSim) { - return Integer.MIN_VALUE; - } - /** - * Return a list of all @link EuiccProfileInfo}s. - * - * @param slotId ID of the SIM slot to use for the operation. - * @return The result of the operation. - * @see android.telephony.SubscriptionManager#getAccessibleSubscriptionInfoList - */ - public abstract GetEuiccProfileInfoListResult onGetEuiccProfileInfoList(int slotId); - /** - * Return info about the eUICC chip/device. - * - * @param slotId ID of the SIM slot to use for the operation. - * @return the {@link EuiccInfo} for the eUICC chip/device. - * @see android.telephony.euicc.EuiccManager#getEuiccInfo - */ - public abstract EuiccInfo onGetEuiccInfo(int slotId); - /** - * Delete the given subscription. - * - *

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. - * @param iccid the ICCID of the subscription to delete. - * @return the result of the delete operation. May be one of the predefined {@code RESULT_} - * constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}. - * @see android.telephony.euicc.EuiccManager#deleteSubscription - */ - public abstract int onDeleteSubscription(int slotId, String iccid); - /** - * Switch to the given subscription. - * - * @param slotId ID of the SIM slot to use for the operation. - * @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 #RESULT_MUST_DEACTIVATE_SIM} - * should be returned to allow the user to consent to this operation first. - * @return the result of the switch operation. May be one of the predefined {@code RESULT_} - * constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}. - * @see android.telephony.euicc.EuiccManager#switchToSubscription - * - * @deprecated prefer {@link #onSwitchToSubscriptionWithPort(int, int, String, boolean)} - */ - @Deprecated public abstract int onSwitchToSubscription(int slotId, - String iccid, boolean forceDeactivateSim); - /** - * Switch to the given subscription. - * - * @param slotId ID of the SIM slot to use for the operation. - * @param portIndex which port on the eUICC to use - * @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 #RESULT_MUST_DEACTIVATE_SIM} - * should be returned to allow the user to consent to this operation first. - * @return the result of the switch operation. May be one of the predefined {@code RESULT_} - * constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}. - * @see android.telephony.euicc.EuiccManager#switchToSubscription - */ - public int onSwitchToSubscriptionWithPort(int slotId, int portIndex, - String iccid, boolean forceDeactivateSim) { - // stub implementation, LPA needs to implement this - throw new UnsupportedOperationException("LPA must override onSwitchToSubscriptionWithPort"); - } - /** - * Update the nickname of the given subscription. - * - * @param slotId ID of the SIM slot to use for the operation. - * @param iccid the ICCID of the subscription to update. - * @param nickname the new nickname to apply. - * @return the result of the update operation. May be one of the predefined {@code RESULT_} - * constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}. - * @see android.telephony.euicc.EuiccManager#updateSubscriptionNickname - */ - public abstract int onUpdateSubscriptionNickname(int slotId, String iccid, - String nickname); - /** - * Erase all operational 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. - * @return the result of the erase operation. May be one of the predefined {@code RESULT_} - * constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}. - * - * @deprecated From R, callers should specify a flag for specific set of subscriptions to erase - * and use {@link #onEraseSubscriptions(int, int)} instead - */ - @Deprecated - public abstract int onEraseSubscriptions(int slotId); - /** - * Erase specific 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 slotIndex index of the SIM slot to use for the operation. - * @param options flag for specific group of subscriptions to erase - * @return the result of the erase operation. May be one of the predefined {@code RESULT_} - * constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}. - */ - public int onEraseSubscriptions(int slotIndex, int options) { - throw new UnsupportedOperationException( - "This method must be overridden to enable the ResetOption parameter"); - } - /** - * Ensure that subscriptions will be retained on the next factory reset. - * - *

Called directly before a factory reset. Assumes that a normal factory reset will lead to - * profiles being erased on first boot (to cover fastboot/recovery wipes), so the implementation - * should persist some bit that will remain accessible after the factory reset to bypass this - * flow when this method is called. - * - * @param slotId ID of the SIM slot to use for the operation. - * @return the result of the operation. May be one of the predefined {@code RESULT_} constants - * or any implementation-specific code starting with {@link #RESULT_FIRST_USER}. - */ - public abstract int onRetainSubscriptionsForFactoryReset(int slotId); - /** - * Dump to a provided printWriter. - */ - public void dump(PrintWriter printWriter) { - printWriter.println("The connected LPA does not implement EuiccService#dump()"); - } -} \ No newline at end of file diff --git a/libs/hidden-apis/src/main/java/android/service/euicc/GetDefaultDownloadableSubscriptionListResult.java b/libs/hidden-apis/src/main/java/android/service/euicc/GetDefaultDownloadableSubscriptionListResult.java deleted file mode 100644 index eec0e22..0000000 --- a/libs/hidden-apis/src/main/java/android/service/euicc/GetDefaultDownloadableSubscriptionListResult.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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.os.Parcel; -import android.os.Parcelable; -import android.telephony.euicc.DownloadableSubscription; -import java.util.List; - -/** - * @hide - */ -public final class GetDefaultDownloadableSubscriptionListResult implements Parcelable { - public static Creator CREATOR = - new Creator() { - @Override - public GetDefaultDownloadableSubscriptionListResult createFromParcel(Parcel in) { - return new GetDefaultDownloadableSubscriptionListResult(in); - } - @Override - public GetDefaultDownloadableSubscriptionListResult[] newArray(int size) { - return new GetDefaultDownloadableSubscriptionListResult[size]; - } - }; - /** - * @hide - * @deprecated - Do no use. Use getResult() instead. - */ - @Deprecated - public final int result = 0; - /** - * Gets the result of the operation. - */ - public int getResult() { - return 0; - } - /** - * Gets the available {@link DownloadableSubscription}s (with filled-in metadata). - */ - public List getDownloadableSubscriptions() { - return null; - } - /** - * Construct a new {@link GetDefaultDownloadableSubscriptionListResult}. - */ - public GetDefaultDownloadableSubscriptionListResult(int result, - DownloadableSubscription[] subscriptions) { - - } - private GetDefaultDownloadableSubscriptionListResult(Parcel in) { - } - @Override - public void writeToParcel(Parcel dest, int flags) { - - } - @Override - public int describeContents() { - return 0; - } -} \ No newline at end of file diff --git a/libs/hidden-apis/src/main/java/android/service/euicc/GetDownloadableSubscriptionMetadataResult.java b/libs/hidden-apis/src/main/java/android/service/euicc/GetDownloadableSubscriptionMetadataResult.java deleted file mode 100644 index f612987..0000000 --- a/libs/hidden-apis/src/main/java/android/service/euicc/GetDownloadableSubscriptionMetadataResult.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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.os.Parcel; -import android.os.Parcelable; -import android.telephony.euicc.DownloadableSubscription; -/** - * @hide - */ -public final class GetDownloadableSubscriptionMetadataResult implements Parcelable { - public static final Creator CREATOR = - new Creator() { - @Override - public GetDownloadableSubscriptionMetadataResult createFromParcel(Parcel in) { - return new GetDownloadableSubscriptionMetadataResult(in); - } - @Override - public GetDownloadableSubscriptionMetadataResult[] newArray(int size) { - return new GetDownloadableSubscriptionMetadataResult[size]; - } - }; - /** - * @hide - * @deprecated - Do no use. Use getResult() instead. - */ - @Deprecated - public final int result = 0; - /** - * Gets the result of the operation. - */ - public int getResult() { - return 0; - } - /** - * Gets the {@link DownloadableSubscription} with filled-in metadata. - */ - public DownloadableSubscription getDownloadableSubscription() { - return null; - } - /** - * Construct a new {@link GetDownloadableSubscriptionMetadataResult}. - */ - public GetDownloadableSubscriptionMetadataResult(int result, - DownloadableSubscription subscription) { - - } - private GetDownloadableSubscriptionMetadataResult(Parcel in) { - - } - @Override - public void writeToParcel(Parcel dest, int flags) { - - } - @Override - public int describeContents() { - return 0; - } -} \ No newline at end of file diff --git a/libs/hidden-apis/src/main/java/android/service/euicc/GetEuiccProfileInfoListResult.java b/libs/hidden-apis/src/main/java/android/service/euicc/GetEuiccProfileInfoListResult.java deleted file mode 100644 index 900d284..0000000 --- a/libs/hidden-apis/src/main/java/android/service/euicc/GetEuiccProfileInfoListResult.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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.os.Parcel; -import android.os.Parcelable; -import java.util.List; -/** - * @hide - */ -public final class GetEuiccProfileInfoListResult implements Parcelable { - public static final Creator CREATOR = - new Creator() { - @Override - public GetEuiccProfileInfoListResult createFromParcel(Parcel in) { - return new GetEuiccProfileInfoListResult(in); - } - @Override - public GetEuiccProfileInfoListResult[] newArray(int size) { - return new GetEuiccProfileInfoListResult[size]; - } - }; - /** - * @hide - * @deprecated - Do no use. Use getResult() instead. - */ - @Deprecated - public final int result = 0; - /** - * Gets the result of the operation. - */ - public int getResult() { - return 0; - } - /** Gets the profile list (only upon success). */ - public List getProfiles() { - return null; - } - /** Gets whether the eUICC is removable. */ - public boolean getIsRemovable() { - return false; - } - /** - * Construct a new {@link GetEuiccProfileInfoListResult}. - * @param isRemovable whether the eUICC in this slot is removable. If true, the profiles - * returned here will only be considered accessible as long as this eUICC is present. - * Otherwise, they will remain accessible until the next time a response with isRemovable - * set to false is returned. - */ - public GetEuiccProfileInfoListResult( - int result, EuiccProfileInfo[] profiles, boolean isRemovable) { - } - private GetEuiccProfileInfoListResult(Parcel in) { - } - @Override - public void writeToParcel(Parcel dest, int flags) { - } - @Override - public int describeContents() { - return 0; - } -} \ No newline at end of file diff --git a/libs/hidden-apis/src/main/java/android/telephony/UiccAccessRule.java b/libs/hidden-apis/src/main/java/android/telephony/UiccAccessRule.java deleted file mode 100644 index 8eaa42e..0000000 --- a/libs/hidden-apis/src/main/java/android/telephony/UiccAccessRule.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * 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.telephony; -import android.content.pm.PackageInfo; -import android.content.pm.Signature; -import android.os.Parcel; -import android.os.Parcelable; -import java.util.List; - -/** - * Describes a single UICC access rule according to the GlobalPlatform Secure Element Access Control - * specification. - * - * @hide - */ -public final class UiccAccessRule implements Parcelable { - - public static final Creator CREATOR = new Creator() { - @Override - public UiccAccessRule createFromParcel(Parcel in) { - return new UiccAccessRule(in); - } - @Override - public UiccAccessRule[] newArray(int size) { - return new UiccAccessRule[size]; - } - }; - /** - * Encode these access rules as a byte array which can be parsed with {@link #decodeRules}. - * @hide - */ - public static byte[] encodeRules(UiccAccessRule[] accessRules) { - return null; - } - /** - * Decodes {@link CarrierConfigManager#KEY_CARRIER_CERTIFICATE_STRING_ARRAY} values. - * @hide - */ - public static UiccAccessRule[] decodeRulesFromCarrierConfig(String[] certs) { - return null; - } - /** - * Decodes a byte array generated with {@link #encodeRules}. - * @hide - */ - public static UiccAccessRule[] decodeRules(byte[] encodedRules) { - return null; - } - - public UiccAccessRule(byte[] certificateHash, String packageName, long accessType) { - - } - UiccAccessRule(Parcel in) { - - } - @Override - public void writeToParcel(Parcel dest, int flags) { - - } - /** - * Return the package name this rule applies to. - * - * @return the package name, or null if this rule applies to any package signed with the given - * certificate. - */ - public String getPackageName() { - return null; - } - /** - * Returns the hex string of the certificate hash. - */ - public String getCertificateHexString() { - return null; - } - /** - * Returns the carrier privilege status associated with the given package. - * - * @param packageInfo package info fetched from - * {@link android.content.pm.PackageManager#getPackageInfo}. - * {@link android.content.pm.PackageManager#GET_SIGNING_CERTIFICATES} must have been - * passed in. - */ - public int getCarrierPrivilegeStatus(PackageInfo packageInfo) { - return 0; - } - /** - * Returns the carrier privilege status for the given certificate and package name. - * - * @param signature The signature of the certificate. - * @param packageName name of the package. - */ - public int getCarrierPrivilegeStatus(Signature signature, String packageName) { - return 0; - } - /** - * Returns true if the given certificate and package name match this rule's values. - * @hide - */ - public boolean matches(String certHash, String packageName) { - return false; - } - - @Override - public boolean equals(Object obj) { - return false; - } - @Override - public int hashCode() { - int result = 1; - return result; - } - @Override - public String toString() { - return null; - } - @Override - public int describeContents() { - return 0; - } - /** - * Gets all of the Signatures from the given PackageInfo. - * @hide - */ - public static List getSignatures(PackageInfo packageInfo) { - return null; - } - /** - * Converts a Signature into a Certificate hash usable for comparison. - * @hide - */ - public static byte[] getCertHash(Signature signature, String algo) { - return null; - } -} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index ce3d71f..dc1d5a4 100644 --- a/settings.gradle +++ b/settings.gradle @@ -14,4 +14,3 @@ dependencyResolutionManagement { } rootProject.name = "OpenEUICC" include ':app', ':libs:lpad-sm-dp-plus-connector' -include ':libs:hidden-apis'