Merge "Add getPhoneCapability function"
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 958c860..722c2f3 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -8861,7 +8861,7 @@
loge("isMultiSimSupportedInternal: no static configuration available");
return TelephonyManager.MULTISIM_NOT_SUPPORTED_BY_HARDWARE;
}
- if (staticCapability.logicalModemList.size() < 2) {
+ if (staticCapability.getLogicalModemList().size() < 2) {
loge("isMultiSimSupportedInternal: maximum number of modem is < 2");
return TelephonyManager.MULTISIM_NOT_SUPPORTED_BY_HARDWARE;
}
@@ -10341,4 +10341,23 @@
Binder.restoreCallingIdentity(identity);
}
}
+
+ /**
+ * Gets the current phone capability.
+ *
+ * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
+ * @return the PhoneCapability which describes the data connection capability of modem.
+ * It's used to evaluate possible phone config change, for example from single
+ * SIM device to multi-SIM device.
+ */
+ @Override
+ public PhoneCapability getPhoneCapability() {
+ enforceReadPrivilegedPermission("getPhoneCapability");
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ return mPhoneConfigurationManager.getCurrentPhoneCapability();
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
}