From 04877a51c5dd54e7c4a4575d67d875502cef5d8c Mon Sep 17 00:00:00 2001 From: Thomas Nguyen Date: Thu, 16 Feb 2023 11:46:38 -0800 Subject: [PATCH] Update javadoc based on API Council review comments for voting radio power off Bug: 242825507 Test: build Change-Id: I0979c4640632ef11f2743448af41221c38c62863 --- .../android/telephony/TelephonyManager.java | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 66711df4db048..3f5c76d495464 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -10642,12 +10642,20 @@ public class TelephonyManager { * no reason to power it off. When any of the voters want to power it off, it will be turned * off. In case of emergency, the radio will be turned on even if there are some reasons for * powering it off, and these radio off votes will be cleared. - * Multiple apps can vote for the same reason and the last vote will take effect. Each app is - * responsible for its vote. A powering-off vote of a reason will be maintained until it is - * cleared by calling {@link clearRadioPowerOffForReason} for that reason, or an emergency call - * is made, or the device is rebooted. When an app comes backup from a crash, it needs to make - * sure if its vote is as expected. An app can use the API {@link getRadioPowerOffReasons} to - * check its vote. + *

+ * Each API call is for one reason. However, an app can call the API multiple times for multiple + * reasons. Multiple apps can vote for the same reason but the vote of one app does not affect + * the vote of another app. + *

+ * Each app is responsible for its vote. A powering-off vote for a reason of an app will be + * maintained until it is cleared by calling {@link #clearRadioPowerOffForReason(int)} for that + * reason by the app, or an emergency call is made, or the device is rebooted. When an app + * comes backup from a crash, it needs to make sure if its vote is as expected. An app can use + * the API {@link #getRadioPowerOffReasons()} to check its votes. Votes won't be removed when + * an app crashes. + *

+ * User setting for power state is persistent across device reboots. This applies to all users, + * callers must be careful to update the off reasons when the current user changes. * * @param reason The reason for powering off radio. * @throws SecurityException if the caller does not have MODIFY_PHONE_STATE permission. @@ -10704,10 +10712,10 @@ public class TelephonyManager { } /** - * Get reasons for powering off radio, as requested by {@link requestRadioPowerOffForReason}. - * If the reason set is empty, the radio is on in all cases. + * Get reasons for powering off radio of the calling app, as requested by + * {@link #requestRadioPowerOffForReason(int)}. * - * @return Set of reasons for powering off radio. + * @return Set of reasons for powering off radio of the calling app. * @throws SecurityException if the caller does not have READ_PRIVILEGED_PHONE_STATE permission. * @throws IllegalStateException if the Telephony service is not currently available. *