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

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

Merge "Require calling package to be allowlisted for thermal mitigation." am:...

Merge "Require calling package to be allowlisted for thermal mitigation." am: fdad0e26 am: d3b14cf1

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

Change-Id: I11c8750cc9c8cb4c13370f0b30ed087c84629fa5
parents cf8c92b0 d3b14cf1
Loading
Loading
Loading
Loading
+8 −2
Original line number Original line Diff line number Diff line
@@ -14570,7 +14570,12 @@ public class TelephonyManager {
     * DataThrottlingRequest#DATA_THROTTLING_ACTION_NO_DATA_THROTTLING} can still be requested in
     * DataThrottlingRequest#DATA_THROTTLING_ACTION_NO_DATA_THROTTLING} can still be requested in
     * order to undo the mitigations above it (i.e {@link
     * order to undo the mitigations above it (i.e {@link
     * ThermalMitigationRequest#THERMAL_MITIGATION_ACTION_VOICE_ONLY} and/or {@link
     * ThermalMitigationRequest#THERMAL_MITIGATION_ACTION_VOICE_ONLY} and/or {@link
     * ThermalMitigationRequest#THERMAL_MITIGATION_ACTION_RADIO_OFF}).
     * ThermalMitigationRequest#THERMAL_MITIGATION_ACTION_RADIO_OFF}). </p>
     *
     * <p> In addition to the {@link Manifest.permission#MODIFY_PHONE_STATE} permission, callers of
     * this API must also be listed in the device configuration as an authorized app in
     * {@code packages/services/Telephony/res/values/config.xml} under the
     * {@code thermal_mitigation_allowlisted_packages} key. </p>
     *
     *
     * @param thermalMitigationRequest Thermal mitigation request. See {@link
     * @param thermalMitigationRequest Thermal mitigation request. See {@link
     * ThermalMitigationRequest} for details.
     * ThermalMitigationRequest} for details.
@@ -14589,7 +14594,8 @@ public class TelephonyManager {
        try {
        try {
            ITelephony telephony = getITelephony();
            ITelephony telephony = getITelephony();
            if (telephony != null) {
            if (telephony != null) {
                return telephony.sendThermalMitigationRequest(getSubId(), thermalMitigationRequest);
                return telephony.sendThermalMitigationRequest(getSubId(), thermalMitigationRequest,
                        getOpPackageName());
            }
            }
            throw new IllegalStateException("telephony service is null.");
            throw new IllegalStateException("telephony service is null.");
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
+3 −1
Original line number Original line Diff line number Diff line
@@ -2236,10 +2236,12 @@ interface ITelephony {
     *
     *
     * @param subId the id of the subscription
     * @param subId the id of the subscription
     * @param thermalMitigationRequest holds the parameters necessary for the request.
     * @param thermalMitigationRequest holds the parameters necessary for the request.
     * @param callingPackage the package name of the calling package.
     * @throws InvalidThermalMitigationRequestException if the parametes are invalid.
     * @throws InvalidThermalMitigationRequestException if the parametes are invalid.
     */
     */
    int sendThermalMitigationRequest(int subId,
    int sendThermalMitigationRequest(int subId,
            in ThermalMitigationRequest thermalMitigationRequest);
            in ThermalMitigationRequest thermalMitigationRequest,
            String callingPackage);


    /**
    /**
     * Get the Generic Bootstrapping Architecture authentication keys
     * Get the Generic Bootstrapping Architecture authentication keys