Merge "Add capability for thermal mitigation." am: 1cc1558ea6 am: 75c0c02fd4 am: f727323567
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1621704 Change-Id: I703c16f9d1ecaa5041072114b112600fcad92eff
This commit is contained in:
@@ -11902,6 +11902,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
|
||||
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@@ -14928,12 +14928,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 {}
|
||||
|
||||
@@ -15043,11 +15054,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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user