Merge "Add capability for thermal mitigation." am: 1cc1558ea6

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1621704

Change-Id: I6a69da053ea9a413d779e9c7f4d8c7eed96dace1
This commit is contained in:
Jack Nudelman
2021-03-22 12:01:29 +00:00
committed by Automerger Merge Worker
3 changed files with 37 additions and 2 deletions

View File

@@ -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

View File

@@ -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;
/**

View File

@@ -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
*/