Implemement method to refresh the UICC profile for testing
Bug: 74016670
Test: simappdialog GTS tests
Change-Id: I47437db84dea7accf67791bea529a36bc7a4c66f
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index a1ddef1..ba51dd3 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -4204,6 +4204,37 @@
}
/**
+ * A test API to reload the UICC profile.
+ *
+ * <p>Requires that the calling app has permission
+ * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
+ * @hide
+ */
+ @Override
+ public void refreshUiccProfile(int subId) {
+ enforceModifyPermission();
+
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ Phone phone = getPhone(subId);
+ if (phone == null) {
+ return;
+ }
+ UiccCard uiccCard = phone.getUiccCard();
+ if (uiccCard == null) {
+ return;
+ }
+ UiccProfile uiccProfile = uiccCard.getUiccProfile();
+ if (uiccProfile == null) {
+ return;
+ }
+ uiccProfile.refresh();
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
+
+ /**
* Returns false if the mobile data is disabled by default, otherwise return true.
*/
private boolean getDefaultDataEnabled() {