Add Radio Interface Capabilities
* Introduces a set of capabilities specific for the radio interface
that are determined by the vendor and are then surfaced through
TelephonyManager.
* There are no capabilities yet defined and will come later in S
* Modified the phone boot up process to read these from the HAL first
Test: Added cts, ran cts, and std tests
Test: Tested that the proper log messages on the device both
during boot up and cts (eg. the logs were just shown once)
Bug: 163085807
Merged-In: I8a6c1c8c45feff98ea4bfaa81da76655168a3816
Change-Id: I4e33a6b21408721adb407255e42fb1f778edb3d4
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index d80efdd..3e608d2 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -87,6 +87,7 @@
import android.telephony.PhoneNumberRange;
import android.telephony.RadioAccessFamily;
import android.telephony.RadioAccessSpecifier;
+import android.telephony.RadioInterfaceCapabilities;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.SignalStrengthUpdateRequest;
@@ -9326,6 +9327,18 @@
}
@Override
+ public boolean isRadioInterfaceCapabilitySupported(
+ @NonNull @TelephonyManager.RadioInterfaceCapability String capability) {
+ RadioInterfaceCapabilities radioInterfaceCapabilities =
+ mPhoneConfigurationManager.getRadioInterfaceCapabilities();
+ if (radioInterfaceCapabilities == null) {
+ throw new RuntimeException("radio interface capabilities are not available");
+ } else {
+ return radioInterfaceCapabilities.isSupported(capability);
+ }
+ }
+
+ @Override
public void bootstrapAuthenticationRequest(int subId, int appType, Uri nafUrl,
UaSecurityProtocolIdentifier securityProtocol,
boolean forceBootStrapping, IBootstrapAuthenticationCallback callback)
@@ -9424,8 +9437,8 @@
switch (thermalMitigationAction) {
case ThermalMitigationRequest.THERMAL_MITIGATION_ACTION_DATA_THROTTLING:
thermalMitigationResult =
- handleDataThrottlingRequest(subId,
- thermalMitigationRequest.getDataThrottlingRequest());
+ handleDataThrottlingRequest(subId,
+ thermalMitigationRequest.getDataThrottlingRequest());
break;
case ThermalMitigationRequest.THERMAL_MITIGATION_ACTION_VOICE_ONLY:
if (thermalMitigationRequest.getDataThrottlingRequest() != null) {
@@ -9458,14 +9471,14 @@
Phone phone = getPhone(subId);
if (phone == null) {
thermalMitigationResult =
- TelephonyManager.THERMAL_MITIGATION_RESULT_MODEM_NOT_AVAILABLE;
+ TelephonyManager.THERMAL_MITIGATION_RESULT_MODEM_NOT_AVAILABLE;
break;
}
if (PhoneConstantConversions.convertCallState(phone.getState())
- != TelephonyManager.CALL_STATE_IDLE
- || phone.isInEmergencySmsMode() || phone.isInEcm()
- || (service != null && service.isEmergencyCallPending())) {
+ != TelephonyManager.CALL_STATE_IDLE
+ || phone.isInEmergencySmsMode() || phone.isInEcm()
+ || (service != null && service.isEmergencyCallPending())) {
String errorMessage = "Phone state is not valid. call state = "
+ PhoneConstantConversions.convertCallState(phone.getState())
+ " isInEmergencySmsMode = " + phone.isInEmergencySmsMode()
@@ -9476,7 +9489,7 @@
+ service.isEmergencyCallPending();
Log.e(LOG_TAG, errorMessage);
thermalMitigationResult =
- TelephonyManager.THERMAL_MITIGATION_RESULT_INVALID_STATE;
+ TelephonyManager.THERMAL_MITIGATION_RESULT_INVALID_STATE;
break;
}
} else {
@@ -9493,7 +9506,7 @@
break;
}
thermalMitigationResult =
- TelephonyManager.THERMAL_MITIGATION_RESULT_SUCCESS;
+ TelephonyManager.THERMAL_MITIGATION_RESULT_SUCCESS;
break;
default:
throw new IllegalArgumentException("the requested thermalMitigationAction does "