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

Commit 4ec1e1f0 authored by Varun Shah's avatar Varun Shah
Browse files

Deprecate PowerWhitelistManager.

Replace all constants and methods to reference the newly added
PowerExemptionManager.

Also keep Context#POWER_EXEMPTION_SERVICE hidden to discourage use of
getSystemService(String). It is still a TestApi for CTS purposes.

Bug: 180503057
Test: atest PowerExemptionManager
Test: atest PowerWhitelistManager
Change-Id: I52c24b79acf7a9ec9fce138d4cb0818b5480e2a0
parent 603b4c4a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ public class DeviceIdleManager {
     * @return package names the system has white-listed to opt out of power save restrictions,
     * except for device idle mode.
     *
     * @hide Should be migrated to PowerWhitelistManager
     * @hide Should be migrated to PowerExemptionManager
     */
    @TestApi
    public @NonNull String[] getSystemPowerWhitelistExceptIdle() {
@@ -80,7 +80,7 @@ public class DeviceIdleManager {
     * @return package names the system has white-listed to opt out of power save restrictions for
     * all modes.
     *
     * @hide Should be migrated to PowerWhitelistManager
     * @hide Should be migrated to PowerExemptionManager
     */
    @TestApi
    public @NonNull String[] getSystemPowerWhitelist() {
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ interface IDeviceIdleController {
    boolean isPowerSaveWhitelistExceptIdleApp(String name);
    boolean isPowerSaveWhitelistApp(String name);
    @UnsupportedAppUsage(maxTargetSdk = 30,
     publicAlternatives = "Use SystemApi {@code PowerWhitelistManager#whitelistAppTemporarily(String, int, String)}.")
     publicAlternatives = "Use SystemApi {@code PowerExemptionManager#addToTemporaryAllowList(String, int, int, String)}.")
    void addPowerSaveTempWhitelistApp(String name, long duration, int userId, int reasonCode, String reason);
    long addPowerSaveTempWhitelistAppForMms(String name, int userId, int reasonCode, String reason);
    long addPowerSaveTempWhitelistAppForSms(String name, int userId, int reasonCode, String reason);
Loading