Include data throttling capability check in CTS.
Test: atest
android.telephony.cts.TelephonyManagerTest#testSendThermalMitigationRequest
on identical change in sc-dev on Redfin.
Bug: 184014147
Change-Id: Id2418042bb6c874c9483654164e80eab363c141e
Merged-In: Id2418042bb6c874c9483654164e80eab363c141e
diff --git a/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTest.java b/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTest.java
index ac58f03..6295762 100644
--- a/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTest.java
+++ b/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTest.java
@@ -3748,9 +3748,14 @@
long arbitraryCompletionWindowSecs = 1L;
+ boolean isDataThrottlingSupported = ShellIdentityUtils.invokeMethodWithShellPermissions(
+ mTelephonyManager, (tm) -> tm.isRadioInterfaceCapabilitySupported(
+ TelephonyManager.CAPABILITY_THERMAL_MITIGATION_DATA_THROTTLING));
- // Test a proper data throttling thermal mitigation request.
- int thermalMitigationResult = ShellIdentityUtils.invokeMethodWithShellPermissions(
+ int thermalMitigationResult = -1;
+ if (isDataThrottlingSupported) {
+ // Test a proper data throttling thermal mitigation request.
+ thermalMitigationResult = ShellIdentityUtils.invokeMethodWithShellPermissions(
mTelephonyManager, (tm) -> tm.sendThermalMitigationRequest(
new ThermalMitigationRequest.Builder()
.setThermalMitigationAction(ThermalMitigationRequest
@@ -3761,8 +3766,7 @@
.setCompletionDurationMillis(arbitraryCompletionWindowSecs)
.build())
.build()));
- // Only verify the result for supported devices on IRadio 1.6+
- if (mRadioVersion >= RADIO_HAL_VERSION_1_6) {
+
assertEquals(thermalMitigationResult,
TelephonyManager.THERMAL_MITIGATION_RESULT_SUCCESS);
}