Merge "Added getEquivalentHomePlmns API" am: b3a127123f am: 6fde0e9bde am: 0706c8b7ae am: 6e7be0db5b
Original change: https://android-review.googlesource.com/c/platform/packages/services/Telephony/+/1441801
Change-Id: I3c472c1178a6c68f524785a5362524ede1d7a158
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index aaec1c1..d4a5898 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -5237,7 +5237,7 @@
}
}
- /**
+ /**
* Ask the radio to connect to the input network and change selection mode to manual.
*
* @param subId the id of the subscription.
@@ -8669,4 +8669,25 @@
public boolean canConnectTo5GInDsdsMode() {
return mApp.getResources().getBoolean(R.bool.config_5g_connection_in_dsds_mode);
}
+
+ @Override
+ public @NonNull List<String> getEquivalentHomePlmns(int subId, String callingPackage,
+ String callingFeatureId) {
+ if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
+ mApp, subId, callingPackage, callingFeatureId, "getEquivalentHomePlmns")) {
+ throw new SecurityException("Requires READ_PHONE_STATE permission.");
+ }
+
+ Phone phone = getPhone(subId);
+ if (phone == null) {
+ throw new RuntimeException("phone is not available");
+ }
+ // Now that all security checks passes, perform the operation as ourselves.
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ return phone.getEquivalentHomePlmns();
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
}