Merge "Add Radio Interface Capabilities" am: 76d8cfd293
Original change: https://android-review.googlesource.com/c/platform/packages/services/Telephony/+/1522308
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I1d7a63a3bb78ab79b3d701c4ad8b0c082bc1aece
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 "