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

Commit ee2981bb authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge changes from topic "ThermalMitigationAosp" am: 7327f956 am: 67d452ab

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1510173

Change-Id: I74f554bb7b8b4cc8a1342760f28a81939fe76ae7
parents aa15d8cf 67d452ab
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -2594,8 +2594,9 @@ public interface CommandsInterface {
     * @param workSource calling Worksource
     * @param dataThrottlingAction the DataThrottlingAction that is being requested.
     *      Defined in android.hardware.radio@1.6.types.
     * @param completionWindowSecs seconds in which data throttling action has to be achieved.
     * @param completionWindowMillis milliseconds in which data throttling action has to be
     *      achieved.
     */
    default void setDataThrottling(Message result, WorkSource workSource,
            int dataThrottlingAction, int completionWindowSecs) {};
            int dataThrottlingAction, long completionWindowMillis) {};
}
+9 −1
Original line number Diff line number Diff line
@@ -1658,7 +1658,15 @@ public class GsmCdmaPhone extends Phone {
    @Override
    public void setRadioPower(boolean power, boolean forEmergencyCall,
            boolean isSelectedPhoneForEmergencyCall, boolean forceApply) {
        mSST.setRadioPower(power, forEmergencyCall, isSelectedPhoneForEmergencyCall, forceApply);
        setRadioPowerForReason(power, forEmergencyCall, isSelectedPhoneForEmergencyCall, forceApply,
                Phone.RADIO_POWER_REASON_USER);
    }

    @Override
    public void setRadioPowerForReason(boolean power, boolean forEmergencyCall,
            boolean isSelectedPhoneForEmergencyCall, boolean forceApply, int reason) {
        mSST.setRadioPowerForReason(power, forEmergencyCall, isSelectedPhoneForEmergencyCall,
                forceApply, reason);
    }

    private void storeVoiceMailNumber(String number) {
+5 −4
Original line number Diff line number Diff line
@@ -4203,11 +4203,12 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
     * @param workSource calling Worksource
     * @param dataThrottlingAction the DataThrottlingAction that is being requested. Defined in
     *      android.telephony.TelephonyManger.
     * @param completionWindowSecs seconds in which data throttling action has to be achieved.
     * @param completionWindowMillis milliseconds in which data throttling action has to be
     *      achieved.
     */
    public void setDataThrottling(Message result, WorkSource workSource,
            int dataThrottlingAction, int completionWindowSecs) {
        mCi.setDataThrottling(result, workSource, dataThrottlingAction, completionWindowSecs);
            int dataThrottlingAction, long completionWindowMillis) {
        mCi.setDataThrottling(result, workSource, dataThrottlingAction, completionWindowMillis);
    }

    /**
+72 −3
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.internal.telephony;

import android.annotation.IntDef;
import android.annotation.NonNull;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Build;
@@ -33,6 +34,8 @@ import android.telephony.TelephonyManager;

import com.android.internal.telephony.PhoneConstants.DataState;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.List;

/**
@@ -162,6 +165,16 @@ public interface PhoneInternalInterface {
    static final String REASON_DATA_ENABLED_OVERRIDE = "dataEnabledOverride";
    static final String REASON_IWLAN_DATA_SERVICE_DIED = "iwlanDataServiceDied";

    // Reasons for Radio being powered off
    int RADIO_POWER_REASON_USER = 0;
    int RADIO_POWER_REASON_THERMAL = 1;
    @Retention(RetentionPolicy.SOURCE)
    @IntDef(prefix = {"RADIO_POWER_REASON_"},
        value = {
            RADIO_POWER_REASON_USER,
            RADIO_POWER_REASON_THERMAL})
    public @interface RadioPowerReason {}

    // Used for band mode selection methods
    static final int BM_UNSPECIFIED = RILConstants.BAND_MODE_UNSPECIFIED; // automatic
    static final int BM_EURO_BAND   = RILConstants.BAND_MODE_EURO;
@@ -513,7 +526,10 @@ public interface PhoneInternalInterface {
     * <strong>Note: </strong>This request is asynchronous.
     * getServiceState().getState() will not change immediately after this call.
     * registerForServiceStateChanged() to find out when the
     * request is complete.
     * request is complete. This will set the reason for radio power state as {@link
     * #RADIO_POWER_REASON_USER}. This will not guarantee that the requested radio power state will
     * actually be set. See {@link #setRadioPowerForReason(boolean, boolean, boolean, boolean, int)}
     * for details.
     *
     * @param power true means "on", false means "off".
     */
@@ -529,7 +545,10 @@ public interface PhoneInternalInterface {
     * <strong>Note: </strong>This request is asynchronous.
     * getServiceState().getState() will not change immediately after this call.
     * registerForServiceStateChanged() to find out when the
     * request is complete.
     * request is complete. This will set the reason for radio power state as {@link
     * #RADIO_POWER_REASON_USER}. This will not guarantee that the requested radio power state will
     * actually be set. See {@link #setRadioPowerForReason(boolean, boolean, boolean, boolean, int)}
     * for details.
     *
     * @param power true means "on", false means "off".
     * @param forEmergencyCall true means the purpose of turning radio power on is for emergency
@@ -543,7 +562,57 @@ public interface PhoneInternalInterface {
     *                   power on again with forEmergencyCall being false.
     */
    default void setRadioPower(boolean power, boolean forEmergencyCall,
            boolean isSelectedPhoneForEmergencyCall, boolean forceApply) {}
            boolean isSelectedPhoneForEmergencyCall, boolean forceApply) {
        setRadioPowerForReason(power, forEmergencyCall, isSelectedPhoneForEmergencyCall, forceApply,
                RADIO_POWER_REASON_USER);
    }

    /**
     * Sets the radio power on/off state (off is sometimes
     * called "airplane mode") for the specified reason, if possible. Current state can be gotten
     * via {@link #getServiceState()}.{@link
     * android.telephony.ServiceState#getState() getState()}.
     * <strong>Note: </strong>This request is asynchronous.
     * getServiceState().getState() will not change immediately after this call.
     * registerForServiceStateChanged() to find out when the
     * request is complete. Radio power will not be set if it is currently off for a reason other
     * than the reason for which it is being turned on. However, if forEmergency call is {@code
     * true}, it will forcefully turn radio power on.
     *
     * @param power true means "on", false means "off".
     * @param reason RadioPowerReason constant defining the reason why the radio power was set.
     */
    default void setRadioPowerForReason(boolean power, @RadioPowerReason int reason) {
        setRadioPowerForReason(power, false, false, false, reason);
    }

    /**
     * Sets the radio power on/off state with option to specify whether it's for emergency call
     * (off is sometimes called "airplane mode") and option to set the reason for setting the power
     * state. Current state can be gotten via {@link #getServiceState()}.
     * {@link android.telephony.ServiceState#getState() getState()}.
     * <strong>Note: </strong>This request is asynchronous.
     * getServiceState().getState() will not change immediately after this call.
     * registerForServiceStateChanged() to find out when the
     * request is complete. Radio power will not be set if it is currently off for a reason other
     * than the reason for which it is being turned on. However, if forEmergency call is {@code
     * true}, it will forcefully turn radio power on.
     *
     * @param power true means "on", false means "off".
     * @param forEmergencyCall true means the purpose of turning radio power on is for emergency
     *                         call. No effect if power is set false.
     * @param isSelectedPhoneForEmergencyCall true means this phone / modem is selected to place
     *                                  emergency call after turning power on. No effect if power
     *                                  or forEmergency is set false.
     * @param forceApply true means always call setRadioPower HAL API without checking against
     *                   current radio power state. It's needed when: radio was powered on into
     *                   emergency call mode, to exit from that mode, we set radio
     *                   power on again with forEmergencyCall being false.
     * @param reason RadioPowerReason constant defining the reason why the radio power was set.
     */
    default void setRadioPowerForReason(boolean power, boolean forEmergencyCall,
            boolean isSelectedPhoneForEmergencyCall, boolean forceApply,
            @RadioPowerReason int reason) {}

    /**
     * Get the line 1 phone number (MSISDN). For CDMA phones, the MDN is returned
+5 −5
Original line number Diff line number Diff line
@@ -4877,11 +4877,11 @@ public class RIL extends BaseCommands implements CommandsInterface {
     * @param workSource calling Worksource
     * @param dataThrottlingAction the DataThrottlingAction that is being requested. Defined in
     *      android.hardware.radio@1.6.types.
     * @param completionWindowSecs seconds in which full throttling has to be achieved.
     * @param completionWindowMillis milliseconds in which full throttling has to be achieved.
     */
    @Override
    public void setDataThrottling(Message result, WorkSource workSource, int dataThrottlingAction,
            int completionWindowSecs) {
            long completionWindowMillis) {
        IRadio radioProxy = getRadioProxy(result);
        if (radioProxy != null) {
            if (mRadioVersion.less(RADIO_HAL_VERSION_1_6)) {
@@ -4902,12 +4902,12 @@ public class RIL extends BaseCommands implements CommandsInterface {
                riljLog(rr.serialString() + "> "
                        + requestToString(rr.mRequest)
                        + " dataThrottlingAction = " + dataThrottlingAction
                        + " completionWindowSecs " + completionWindowSecs);
                        + " completionWindowMillis " + completionWindowMillis);
            }

            try {
                radioProxy16.setDataThrottling(rr.mSerial, dataThrottlingAction,
                        completionWindowSecs);
                        completionWindowMillis);
            } catch (RemoteException | RuntimeException e) {
                handleRadioProxyExceptionForRR(rr, "setDataThrottling", e);
            }
Loading