Merge "Add APIs to EuiccCardManager."

This commit is contained in:
Holly Jiuyu Sun
2018-01-18 03:32:22 +00:00
committed by Gerrit Code Review
13 changed files with 467 additions and 2 deletions

View File

@@ -514,19 +514,28 @@ java_library {
"telephony/java/com/android/internal/telephony/IWapPushManager.aidl",
"telephony/java/com/android/internal/telephony/euicc/IAuthenticateServerCallback.aidl",
"telephony/java/com/android/internal/telephony/euicc/ICancelSessionCallback.aidl",
"telephony/java/com/android/internal/telephony/euicc/IDeleteProfileCallback.aidl",
"telephony/java/com/android/internal/telephony/euicc/IDisableProfileCallback.aidl",
"telephony/java/com/android/internal/telephony/euicc/IEuiccCardController.aidl",
"telephony/java/com/android/internal/telephony/euicc/IEuiccController.aidl",
"telephony/java/com/android/internal/telephony/euicc/IGetAllProfilesCallback.aidl",
"telephony/java/com/android/internal/telephony/euicc/IGetDefaultSmdpAddressCallback.aidl",
"telephony/java/com/android/internal/telephony/euicc/IGetEuiccChallengeCallback.aidl",
"telephony/java/com/android/internal/telephony/euicc/IGetEuiccInfo1Callback.aidl",
"telephony/java/com/android/internal/telephony/euicc/IGetEuiccInfo2Callback.aidl",
"telephony/java/com/android/internal/telephony/euicc/IGetProfileCallback.aidl",
"telephony/java/com/android/internal/telephony/euicc/IGetRulesAuthTableCallback.aidl",
"telephony/java/com/android/internal/telephony/euicc/IGetSmdsAddressCallback.aidl",
"telephony/java/com/android/internal/telephony/euicc/IListNotificationsCallback.aidl",
"telephony/java/com/android/internal/telephony/euicc/ILoadBoundProfilePackageCallback.aidl",
"telephony/java/com/android/internal/telephony/euicc/IPrepareDownloadCallback.aidl",
"telephony/java/com/android/internal/telephony/euicc/IRemoveNotificationFromListCallback.aidl",
"telephony/java/com/android/internal/telephony/euicc/IResetMemoryCallback.aidl",
"telephony/java/com/android/internal/telephony/euicc/IRetrieveNotificationCallback.aidl",
"telephony/java/com/android/internal/telephony/euicc/IRetrieveNotificationListCallback.aidl",
"telephony/java/com/android/internal/telephony/euicc/ISetDefaultSmdpAddressCallback.aidl",
"telephony/java/com/android/internal/telephony/euicc/ISetNicknameCallback.aidl",
"telephony/java/com/android/internal/telephony/euicc/ISwitchToProfileCallback.aidl",
"wifi/java/android/net/wifi/IWifiManager.aidl",
"wifi/java/android/net/wifi/aware/IWifiAwareEventCallback.aidl",
"wifi/java/android/net/wifi/aware/IWifiAwareManager.aidl",

View File

@@ -698,4 +698,5 @@ ifeq (,$(ONE_SHOT_MAKEFILE))
include $(call first-makefiles-under,$(LOCAL_PATH))
endif
endif # ANDROID_BUILD_EMBEDDED
endif # ANDROID_BUILD_EMBEDDED

View File

@@ -25,18 +25,27 @@ import android.util.Log;
import com.android.internal.telephony.euicc.IAuthenticateServerCallback;
import com.android.internal.telephony.euicc.ICancelSessionCallback;
import com.android.internal.telephony.euicc.IDeleteProfileCallback;
import com.android.internal.telephony.euicc.IDisableProfileCallback;
import com.android.internal.telephony.euicc.IEuiccCardController;
import com.android.internal.telephony.euicc.IGetAllProfilesCallback;
import com.android.internal.telephony.euicc.IGetDefaultSmdpAddressCallback;
import com.android.internal.telephony.euicc.IGetEuiccChallengeCallback;
import com.android.internal.telephony.euicc.IGetEuiccInfo1Callback;
import com.android.internal.telephony.euicc.IGetEuiccInfo2Callback;
import com.android.internal.telephony.euicc.IGetProfileCallback;
import com.android.internal.telephony.euicc.IGetRulesAuthTableCallback;
import com.android.internal.telephony.euicc.IGetSmdsAddressCallback;
import com.android.internal.telephony.euicc.IListNotificationsCallback;
import com.android.internal.telephony.euicc.ILoadBoundProfilePackageCallback;
import com.android.internal.telephony.euicc.IPrepareDownloadCallback;
import com.android.internal.telephony.euicc.IRemoveNotificationFromListCallback;
import com.android.internal.telephony.euicc.IResetMemoryCallback;
import com.android.internal.telephony.euicc.IRetrieveNotificationCallback;
import com.android.internal.telephony.euicc.IRetrieveNotificationListCallback;
import com.android.internal.telephony.euicc.ISetDefaultSmdpAddressCallback;
import com.android.internal.telephony.euicc.ISetNicknameCallback;
import com.android.internal.telephony.euicc.ISwitchToProfileCallback;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -80,6 +89,24 @@ public class EuiccCardManager {
*/
public static final int CANCEL_REASON_PPR_NOT_ALLOWED = 3;
/** Options for resetting eUICC memory */
@Retention(RetentionPolicy.SOURCE)
@IntDef(flag = true, prefix = { "RESET_OPTION_" }, value = {
RESET_OPTION_DELETE_OPERATIONAL_PROFILES,
RESET_OPTION_DELETE_FIELD_LOADED_TEST_PROFILES,
RESET_OPTION_RESET_DEFAULT_SMDP_ADDRESS
})
public @interface ResetOption {}
/** Deletes all operational profiles. */
public static final int RESET_OPTION_DELETE_OPERATIONAL_PROFILES = 1;
/** Deletes all field-loaded testing profiles. */
public static final int RESET_OPTION_DELETE_FIELD_LOADED_TEST_PROFILES = 1 << 1;
/** Resets the default SM-DP+ address. */
public static final int RESET_OPTION_RESET_DEFAULT_SMDP_ADDRESS = 1 << 2;
/** Result code of execution with no error. */
public static final int RESULT_OK = 0;
@@ -115,7 +142,7 @@ public class EuiccCardManager {
/**
* Gets all the profiles on eUicc.
*
* @param callback the callback to get the result code and all the profiles.
* @param callback The callback to get the result code and all the profiles.
*/
public void getAllProfiles(ResultCallback<EuiccProfileInfo[]> callback) {
try {
@@ -132,6 +159,214 @@ public class EuiccCardManager {
}
}
/**
* Gets the profile of the given iccid.
*
* @param iccid The iccid of the profile.
* @param callback The callback to get the result code and profile.
*/
public void getProfile(String iccid, ResultCallback<EuiccProfileInfo> callback) {
try {
getIEuiccCardController().getProfile(mContext.getOpPackageName(), iccid,
new IGetProfileCallback.Stub() {
@Override
public void onComplete(int resultCode, EuiccProfileInfo profile) {
callback.onComplete(resultCode, profile);
}
});
} catch (RemoteException e) {
Log.e(TAG, "Error calling getProfile", e);
throw e.rethrowFromSystemServer();
}
}
/**
* Disables the profile of the given iccid.
*
* @param iccid The iccid of the profile.
* @param refresh Whether sending the REFRESH command to modem.
* @param callback The callback to get the result code.
*/
public void disableProfile(String iccid, boolean refresh, ResultCallback<Void> callback) {
try {
getIEuiccCardController().disableProfile(mContext.getOpPackageName(), iccid, refresh,
new IDisableProfileCallback.Stub() {
@Override
public void onComplete(int resultCode) {
callback.onComplete(resultCode, null);
}
});
} catch (RemoteException e) {
Log.e(TAG, "Error calling disableProfile", e);
throw e.rethrowFromSystemServer();
}
}
/**
* Switches from the current profile to another profile. The current profile will be disabled
* and the specified profile will be enabled.
*
* @param iccid The iccid of the profile to switch to.
* @param refresh Whether sending the REFRESH command to modem.
* @param callback The callback to get the result code and the EuiccProfileInfo enabled.
*/
public void switchToProfile(String iccid, boolean refresh,
ResultCallback<EuiccProfileInfo> callback) {
try {
getIEuiccCardController().switchToProfile(mContext.getOpPackageName(), iccid, refresh,
new ISwitchToProfileCallback.Stub() {
@Override
public void onComplete(int resultCode, EuiccProfileInfo profile) {
callback.onComplete(resultCode, profile);
}
});
} catch (RemoteException e) {
Log.e(TAG, "Error calling switchToProfile", e);
throw e.rethrowFromSystemServer();
}
}
/**
* Gets the EID of the eUICC.
*
* @return The EID.
*/
public String getEid() {
try {
return getIEuiccCardController().getEid();
} catch (RemoteException e) {
Log.e(TAG, "Error calling getEid", e);
throw e.rethrowFromSystemServer();
}
}
/**
* Sets the nickname of the profile of the given iccid.
*
* @param iccid The iccid of the profile.
* @param nickname The nickname of the profile.
* @param callback The callback to get the result code.
*/
public void setNickname(String iccid, String nickname, ResultCallback<Void> callback) {
try {
getIEuiccCardController().setNickname(mContext.getOpPackageName(), iccid, nickname,
new ISetNicknameCallback.Stub() {
@Override
public void onComplete(int resultCode) {
callback.onComplete(resultCode, null);
}
});
} catch (RemoteException e) {
Log.e(TAG, "Error calling setNickname", e);
throw e.rethrowFromSystemServer();
}
}
/**
* Deletes the profile of the given iccid from eUICC.
*
* @param iccid The iccid of the profile.
* @param callback The callback to get the result code.
*/
public void deleteProfile(String iccid, ResultCallback<Void> callback) {
try {
getIEuiccCardController().deleteProfile(mContext.getOpPackageName(), iccid,
new IDeleteProfileCallback.Stub() {
@Override
public void onComplete(int resultCode) {
callback.onComplete(resultCode, null);
}
});
} catch (RemoteException e) {
Log.e(TAG, "Error calling deleteProfile", e);
throw e.rethrowFromSystemServer();
}
}
/**
* Resets the eUICC memory.
*
* @param options Bits of the options of resetting which parts of the eUICC memory. See
* EuiccCard for details.
* @param callback The callback to get the result code.
*/
public void resetMemory(@ResetOption int options, ResultCallback<Void> callback) {
try {
getIEuiccCardController().resetMemory(mContext.getOpPackageName(), options,
new IResetMemoryCallback.Stub() {
@Override
public void onComplete(int resultCode) {
callback.onComplete(resultCode, null);
}
});
} catch (RemoteException e) {
Log.e(TAG, "Error calling resetMemory", e);
throw e.rethrowFromSystemServer();
}
}
/**
* Gets the default SM-DP+ address from eUICC.
*
* @param callback The callback to get the result code and the default SM-DP+ address.
*/
public void getDefaultSmdpAddress(ResultCallback<String> callback) {
try {
getIEuiccCardController().getDefaultSmdpAddress(mContext.getOpPackageName(),
new IGetDefaultSmdpAddressCallback.Stub() {
@Override
public void onComplete(int resultCode, String address) {
callback.onComplete(resultCode, address);
}
});
} catch (RemoteException e) {
Log.e(TAG, "Error calling getDefaultSmdpAddress", e);
throw e.rethrowFromSystemServer();
}
}
/**
* Gets the SM-DS address from eUICC.
*
* @param callback The callback to get the result code and the SM-DS address.
*/
public void getSmdsAddress(ResultCallback<String> callback) {
try {
getIEuiccCardController().getSmdsAddress(mContext.getOpPackageName(),
new IGetSmdsAddressCallback.Stub() {
@Override
public void onComplete(int resultCode, String address) {
callback.onComplete(resultCode, address);
}
});
} catch (RemoteException e) {
Log.e(TAG, "Error calling getSmdsAddress", e);
throw e.rethrowFromSystemServer();
}
}
/**
* Sets the default SM-DP+ address of eUICC.
*
* @param defaultSmdpAddress The default SM-DP+ address to set.
* @param callback The callback to get the result code.
*/
public void setDefaultSmdpAddress(String defaultSmdpAddress, ResultCallback<Void> callback) {
try {
getIEuiccCardController().setDefaultSmdpAddress(mContext.getOpPackageName(),
defaultSmdpAddress,
new ISetDefaultSmdpAddressCallback.Stub() {
@Override
public void onComplete(int resultCode) {
callback.onComplete(resultCode, null);
}
});
} catch (RemoteException e) {
Log.e(TAG, "Error calling setDefaultSmdpAddress", e);
throw e.rethrowFromSystemServer();
}
}
/**
* Gets Rules Authorisation Table.
*

View File

@@ -0,0 +1,21 @@
/*
* 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 com.android.internal.telephony.euicc;
/** @hide */
oneway interface IDeleteProfileCallback {
void onComplete(int resultCode);
}

View File

@@ -0,0 +1,23 @@
/*
* 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 com.android.internal.telephony.euicc;
import android.service.euicc.EuiccProfileInfo;
/** @hide */
oneway interface IDisableProfileCallback {
void onComplete(int resultCode);
}

View File

@@ -17,6 +17,15 @@
package com.android.internal.telephony.euicc;
import com.android.internal.telephony.euicc.IGetAllProfilesCallback;
import com.android.internal.telephony.euicc.IGetProfileCallback;
import com.android.internal.telephony.euicc.IDisableProfileCallback;
import com.android.internal.telephony.euicc.ISwitchToProfileCallback;
import com.android.internal.telephony.euicc.ISetNicknameCallback;
import com.android.internal.telephony.euicc.IDeleteProfileCallback;
import com.android.internal.telephony.euicc.IResetMemoryCallback;
import com.android.internal.telephony.euicc.IGetDefaultSmdpAddressCallback;
import com.android.internal.telephony.euicc.IGetSmdsAddressCallback;
import com.android.internal.telephony.euicc.ISetDefaultSmdpAddressCallback;
import com.android.internal.telephony.euicc.IAuthenticateServerCallback;
import com.android.internal.telephony.euicc.ICancelSessionCallback;
import com.android.internal.telephony.euicc.IGetEuiccChallengeCallback;
@@ -33,6 +42,22 @@ import com.android.internal.telephony.euicc.IRetrieveNotificationListCallback;
/** @hide */
interface IEuiccCardController {
oneway void getAllProfiles(String callingPackage, in IGetAllProfilesCallback callback);
oneway void getProfile(String callingPackage, String iccid, in IGetProfileCallback callback);
oneway void disableProfile(String callingPackage, String iccid, boolean refresh,
in IDisableProfileCallback callback);
oneway void switchToProfile(String callingPackage, String iccid, boolean refresh,
in ISwitchToProfileCallback callback);
String getEid();
oneway void setNickname(String callingPackage, String iccid, String nickname,
in ISetNicknameCallback callback);
oneway void deleteProfile(String callingPackage, String iccid,
in IDeleteProfileCallback callback);
oneway void resetMemory(String callingPackage, int options, in IResetMemoryCallback callback);
oneway void getDefaultSmdpAddress(String callingPackage,
in IGetDefaultSmdpAddressCallback callback);
oneway void getSmdsAddress(String callingPackage, in IGetSmdsAddressCallback callback);
oneway void setDefaultSmdpAddress(String callingPackage, String address,
in ISetDefaultSmdpAddressCallback callback);
oneway void getRulesAuthTable(String callingPackage, in IGetRulesAuthTableCallback callback);
oneway void getEuiccChallenge(String callingPackage, in IGetEuiccChallengeCallback callback);
oneway void getEuiccInfo1(String callingPackage, in IGetEuiccInfo1Callback callback);

View File

@@ -0,0 +1,21 @@
/*
* 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 com.android.internal.telephony.euicc;
/** @hide */
oneway interface IGetDefaultSmdpAddressCallback {
void onComplete(int resultCode, String address);
}

View File

@@ -0,0 +1,23 @@
/*
* 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 com.android.internal.telephony.euicc;
import android.service.euicc.EuiccProfileInfo;
/** @hide */
oneway interface IGetProfileCallback {
void onComplete(int resultCode, in EuiccProfileInfo profile);
}

View File

@@ -0,0 +1,21 @@
/*
* 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 com.android.internal.telephony.euicc;
/** @hide */
oneway interface IGetSmdsAddressCallback {
void onComplete(int resultCode, String address);
}

View File

@@ -0,0 +1,21 @@
/*
* 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 com.android.internal.telephony.euicc;
/** @hide */
oneway interface IResetMemoryCallback {
void onComplete(int resultCode);
}

View File

@@ -0,0 +1,21 @@
/*
* 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 com.android.internal.telephony.euicc;
/** @hide */
oneway interface ISetDefaultSmdpAddressCallback {
void onComplete(int resultCode);
}

View File

@@ -0,0 +1,21 @@
/*
* 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 com.android.internal.telephony.euicc;
/** @hide */
oneway interface ISetNicknameCallback {
void onComplete(int resultCode);
}

View File

@@ -0,0 +1,23 @@
/*
* 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 com.android.internal.telephony.euicc;
import android.service.euicc.EuiccProfileInfo;
/** @hide */
oneway interface ISwitchToProfileCallback {
void onComplete(int resultCode, in EuiccProfileInfo profile);
}