Merge "[MEP] set removable eSIM as default eUICC to pass GCF/PTCRB" into tm-dev am: 3e5894b2e8

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18281725

Change-Id: I294b89447a925522dac6b6a1f177624e8984591a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Amruth Ramachandran
2022-05-13 23:55:20 +00:00
committed by Automerger Merge Worker
2 changed files with 51 additions and 0 deletions

View File

@@ -17006,4 +17006,41 @@ public class TelephonyManager {
} }
mTelephonyRegistryMgr.removeCarrierPrivilegesCallback(callback); mTelephonyRegistryMgr.removeCarrierPrivilegesCallback(callback);
} }
/**
* set removable eSIM as default eUICC.
*
* @hide
*/
@RequiresPermission(Manifest.permission.MODIFY_PHONE_STATE)
@RequiresFeature(PackageManager.FEATURE_TELEPHONY_EUICC)
public void setRemovableEsimAsDefaultEuicc(boolean isDefault) {
try {
ITelephony telephony = getITelephony();
if (telephony != null) {
telephony.setRemovableEsimAsDefaultEuicc(isDefault, getOpPackageName());
}
} catch (RemoteException e) {
Log.e(TAG, "Error in setRemovableEsimAsDefault: " + e);
}
}
/**
* Returns whether the removable eSIM is default eUICC or not.
*
* @hide
*/
@RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
@RequiresFeature(PackageManager.FEATURE_TELEPHONY_EUICC)
public boolean isRemovableEsimDefaultEuicc() {
try {
ITelephony telephony = getITelephony();
if (telephony != null) {
return telephony.isRemovableEsimDefaultEuicc(getOpPackageName());
}
} catch (RemoteException e) {
Log.e(TAG, "Error in isRemovableEsimDefaultEuicc: " + e);
}
return false;
}
} }

View File

@@ -2553,4 +2553,18 @@ interface ITelephony {
* for the slot, or {@code null} if none is resolved * for the slot, or {@code null} if none is resolved
*/ */
String getCarrierServicePackageNameForLogicalSlot(int logicalSlotIndex); String getCarrierServicePackageNameForLogicalSlot(int logicalSlotIndex);
/**
* set removable eSIM as default eUICC.
*
* @hide
*/
void setRemovableEsimAsDefaultEuicc(boolean isDefault, String callingPackage);
/**
* Returns whether the removable eSIM is default eUICC or not.
*
* @hide
*/
boolean isRemovableEsimDefaultEuicc(String callingPackage);
} }