Support Manual Network Selection Config
Bug: 143187230
Test: make && make offline-sdk-docs
Change-Id: I208bf96cafb6e6888f3f3c0c106caf8b1dd547e3
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index ad517ee..f63b1df 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -4979,6 +4979,36 @@
Binder.restoreCallingIdentity(identity);
}
}
+ /**
+ * Get the manual network selection
+ *
+ * @param subId the id of the subscription.
+ *
+ * @return the previously saved user selected PLMN
+ */
+ @Override
+ public String getManualNetworkSelectionPlmn(int subId) {
+ TelephonyPermissions
+ .enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
+ mApp, subId, "getManualNetworkSelectionPlmn");
+
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ if (!isActiveSubscription(subId)) {
+ return "";
+ }
+
+ final Phone phone = getPhone(subId);
+ if (phone == null) {
+ return "";
+ }
+ OperatorInfo networkSelection = phone.getSavedNetworkSelection();
+ return TextUtils.isEmpty(networkSelection.getOperatorNumeric())
+ ? phone.getManualNetworkSelectionPlmn() : networkSelection.getOperatorNumeric();
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
/**
* Scans for available networks.