new system API to get supported radioAccessFamily
Bug: 118351153
Test: telephony unit test
Change-Id: I1e9788b990a1672f0cf665611f85a8aa9d8bfda8
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 0587e0e..1e0b473 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -4269,21 +4269,20 @@
@Override
public int getRadioAccessFamily(int phoneId, String callingPackage) {
Phone phone = PhoneFactory.getPhone(phoneId);
+ int raf = RadioAccessFamily.RAF_UNKNOWN;
if (phone == null) {
- return RadioAccessFamily.RAF_UNKNOWN;
+ return raf;
}
- int subId = phone.getSubId();
- if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
- mApp, subId, callingPackage, "getRadioAccessFamily")) {
- return RadioAccessFamily.RAF_UNKNOWN;
- }
-
final long identity = Binder.clearCallingIdentity();
try {
- return ProxyController.getInstance().getRadioAccessFamily(phoneId);
+ TelephonyPermissions
+ .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
+ mApp, phone.getSubId(), "getRadioAccessFamily");
+ raf = ProxyController.getInstance().getRadioAccessFamily(phoneId);
} finally {
Binder.restoreCallingIdentity(identity);
}
+ return raf;
}
@Override