summaryrefslogtreecommitdiff
path: root/telephony/java/android
diff options
context:
space:
mode:
authorJack Nudelman <jacknudelman@google.com>2021-03-12 14:05:59 -0800
committerJack Nudelman <jacknudelman@google.com>2021-03-22 16:33:56 -0700
commita9636128545a1f74d0f2d7b04dcecf83cf29d1ad (patch)
tree34c2fc4518ec9e781c0321aae48b953507fc662a /telephony/java/android
parentd880cf50a54acd6d9d7659db42195e563a4089ed (diff)
Require calling package to be allowlisted for thermal mitigation.
Test: make, manual verification Bug: 180015298 Change-Id: I1884facf5d37e4caa82697dab7e2a30d735f214e
Diffstat (limited to 'telephony/java/android')
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index bae032c7da6c..7c39cf0b47a6 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -14570,7 +14570,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.
@@ -14589,7 +14594,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) {