diff options
author | Jack Nudelman <jacknudelman@google.com> | 2021-03-22 11:38:10 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-03-22 11:38:10 +0000 |
commit | 1cc1558ea6a7b6c091ef924e613ca48c63fed135 (patch) | |
tree | 856e4611d3aafcd986fb20a3ef98427bccf3944d | |
parent | 7a2f9c06ca86d280ad6e8501ceb0070d2a1987b3 (diff) | |
parent | a33f939ef47a3f0c4716640a9cc0c6c7173d5561 (diff) |
Merge "Add capability for thermal mitigation."
-rw-r--r-- | core/api/system-current.txt | 1 | ||||
-rw-r--r-- | telephony/java/android/telephony/DataThrottlingRequest.java | 10 | ||||
-rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 28 |
3 files changed, 37 insertions, 2 deletions
diff --git a/core/api/system-current.txt b/core/api/system-current.txt index b20f63784430..92c18c68c4ff 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -10334,6 +10334,7 @@ package android.telephony { field public static final String CAPABILITY_ALLOWED_NETWORK_TYPES_USED = "CAPABILITY_ALLOWED_NETWORK_TYPES_USED"; field public static final String CAPABILITY_NR_DUAL_CONNECTIVITY_CONFIGURATION_AVAILABLE = "CAPABILITY_NR_DUAL_CONNECTIVITY_CONFIGURATION_AVAILABLE"; field public static final String CAPABILITY_SECONDARY_LINK_BANDWIDTH_VISIBLE = "CAPABILITY_SECONDARY_LINK_BANDWIDTH_VISIBLE"; + field public static final String CAPABILITY_THERMAL_MITIGATION_DATA_THROTTLING = "CAPABILITY_THERMAL_MITIGATION_DATA_THROTTLING"; field public static final int CARRIER_PRIVILEGE_STATUS_ERROR_LOADING_RULES = -2; // 0xfffffffe field public static final int CARRIER_PRIVILEGE_STATUS_HAS_ACCESS = 1; // 0x1 field public static final int CARRIER_PRIVILEGE_STATUS_NO_ACCESS = 0; // 0x0 diff --git a/telephony/java/android/telephony/DataThrottlingRequest.java b/telephony/java/android/telephony/DataThrottlingRequest.java index f50bb58c4b2e..2827e8dc8539 100644 --- a/telephony/java/android/telephony/DataThrottlingRequest.java +++ b/telephony/java/android/telephony/DataThrottlingRequest.java @@ -17,6 +17,7 @@ package android.telephony; import android.annotation.IntDef; import android.annotation.NonNull; +import android.annotation.RequiresFeature; import android.annotation.SystemApi; import android.os.Parcel; import android.os.Parcelable; @@ -52,6 +53,9 @@ public final class DataThrottlingRequest implements Parcelable { * @hide */ @SystemApi + @RequiresFeature( + enforcement = "android.telephony.TelephonyManager#isRadioInterfaceCapabilitySupported", + value = TelephonyManager.CAPABILITY_THERMAL_MITIGATION_DATA_THROTTLING) public static final int DATA_THROTTLING_ACTION_THROTTLE_SECONDARY_CARRIER = 1; /** @@ -63,6 +67,9 @@ public final class DataThrottlingRequest implements Parcelable { * @hide */ @SystemApi + @RequiresFeature( + enforcement = "android.telephony.TelephonyManager#isRadioInterfaceCapabilitySupported", + value = TelephonyManager.CAPABILITY_THERMAL_MITIGATION_DATA_THROTTLING) public static final int DATA_THROTTLING_ACTION_THROTTLE_PRIMARY_CARRIER = 2; /** @@ -76,6 +83,9 @@ public final class DataThrottlingRequest implements Parcelable { * @hide */ @SystemApi + @RequiresFeature( + enforcement = "android.telephony.TelephonyManager#isRadioInterfaceCapabilitySupported", + value = TelephonyManager.CAPABILITY_THERMAL_MITIGATION_DATA_THROTTLING) public static final int DATA_THROTTLING_ACTION_HOLD = 3; /** diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 846d9a7f259f..f637159fcbfb 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -14440,12 +14440,23 @@ public class TelephonyManager { public static final String CAPABILITY_NR_DUAL_CONNECTIVITY_CONFIGURATION_AVAILABLE = "CAPABILITY_NR_DUAL_CONNECTIVITY_CONFIGURATION_AVAILABLE"; + /** + * Indicates whether a data throttling request sent with {@link #sendThermalMitigationRequest} + * is supported. See comments on {@link #sendThermalMitigationRequest} for more information. + * + * @hide + */ + @SystemApi + public static final String CAPABILITY_THERMAL_MITIGATION_DATA_THROTTLING = + "CAPABILITY_THERMAL_MITIGATION_DATA_THROTTLING"; + /** @hide */ @Retention(RetentionPolicy.SOURCE) @StringDef(prefix = "CAPABILITY_", value = { CAPABILITY_SECONDARY_LINK_BANDWIDTH_VISIBLE, CAPABILITY_ALLOWED_NETWORK_TYPES_USED, - CAPABILITY_NR_DUAL_CONNECTIVITY_CONFIGURATION_AVAILABLE + CAPABILITY_NR_DUAL_CONNECTIVITY_CONFIGURATION_AVAILABLE, + CAPABILITY_THERMAL_MITIGATION_DATA_THROTTLING, }) public @interface RadioInterfaceCapability {} @@ -14555,11 +14566,24 @@ public class TelephonyManager { * and can be used at any time during data throttling to hold onto the current level of data * throttling. * + * <p> If {@link android.telephony.TelephonyManager#isRadioInterfaceCapabilitySupported}({@link + * #CAPABILITY_THERMAL_MITIGATION_DATA_THROTTLING}) returns false, then sending a {@link + * DataThrottlingRequest#DATA_THROTTLING_ACTION_HOLD}, {@link + * DataThrottlingRequest#DATA_THROTTLING_ACTION_THROTTLE_SECONDARY_CARRIER}, or {@link + * DataThrottlingRequest#DATA_THROTTLING_ACTION_THROTTLE_PRIMARY_CARRIER} will result in {@link + * IllegalArgumentException} being thrown. However, on devices that do not + * support data throttling, {@link + * DataThrottlingRequest#DATA_THROTTLING_ACTION_NO_DATA_THROTTLING} can still be requested in + * order to undo the mitigations above it (i.e {@link + * ThermalMitigationRequest#THERMAL_MITIGATION_ACTION_VOICE_ONLY} and/or {@link + * ThermalMitigationRequest#THERMAL_MITIGATION_ACTION_RADIO_OFF}). + * * @param thermalMitigationRequest Thermal mitigation request. See {@link * ThermalMitigationRequest} for details. * * @throws IllegalStateException if the Telephony process is not currently available. - * @throws IllegalArgumentException if the thermalMitigationRequest had invalid parameters. + * @throws IllegalArgumentException if the thermalMitigationRequest had invalid parameters or + * if the device's modem does not support data throttling. * * @hide */ |