Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f7273235 authored by Jack Nudelman's avatar Jack Nudelman Committed by Automerger Merge Worker
Browse files

Merge "Add capability for thermal mitigation." am: 1cc1558e am: 75c0c02f

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

Change-Id: If33c887416324e234c33dd42e9b8eeef659f7322
parents 3c975c20 75c0c02f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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
+10 −0
Original line number Diff line number Diff line
@@ -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;

    /**
+26 −2
Original line number Diff line number Diff line
@@ -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
     */