Merge "Require calling package to be allowlisted for thermal mitigation." am: fdad0e26a7 am: d3b14cf1fe am: 6176649cce

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

Change-Id: I6a3a3d4ebd19e8a2de8fcd3ed054600210e1aa31
This commit is contained in:
Jack Nudelman
2021-03-23 14:10:49 +00:00
committed by Automerger Merge Worker
2 changed files with 11 additions and 3 deletions

View File

@@ -15077,7 +15077,12 @@ public class TelephonyManager {
* 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}).
* 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
* ThermalMitigationRequest} for details.
@@ -15096,7 +15101,8 @@ public class TelephonyManager {
try {
ITelephony telephony = getITelephony();
if (telephony != null) {
return telephony.sendThermalMitigationRequest(getSubId(), thermalMitigationRequest);
return telephony.sendThermalMitigationRequest(getSubId(), thermalMitigationRequest,
getOpPackageName());
}
throw new IllegalStateException("telephony service is null.");
} catch (RemoteException ex) {

View File

@@ -2250,10 +2250,12 @@ interface ITelephony {
*
* @param subId the id of the subscription
* @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.
*/
int sendThermalMitigationRequest(int subId,
in ThermalMitigationRequest thermalMitigationRequest);
in ThermalMitigationRequest thermalMitigationRequest,
String callingPackage);
/**
* get the Generic Bootstrapping Architecture authentication keys