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

Commit 69f79be0 authored by Varun Shah's avatar Varun Shah
Browse files

Introduce PowerExemptionManager.

This is essentially identical to PowerWhitelistManager which will be
deprecated due to the use of non-inclusive language.

Bug: 180503057
Test: atest PowerExemptionTest
BYPASS_INCLUSIVE_LANGUAGE_REASON=Existing public API.
Change-Id: Ie6ff50118330e22b59a547c81952a31a5f5b54d8
parent 219aea8c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.app.SystemServiceRegistry;
import android.content.Context;
import android.os.DeviceIdleManager;
import android.os.IDeviceIdleController;
import android.os.PowerExemptionManager;
import android.os.PowerWhitelistManager;

/**
@@ -52,5 +53,8 @@ public class JobSchedulerFrameworkInitializer {
        SystemServiceRegistry.registerContextAwareService(
                Context.POWER_WHITELIST_MANAGER, PowerWhitelistManager.class,
                PowerWhitelistManager::new);
        SystemServiceRegistry.registerContextAwareService(
                Context.POWER_EXEMPTION_SERVICE, PowerExemptionManager.class,
                PowerExemptionManager::new);
    }
}
+626 −0

File added.

Preview size limit exceeded, changes collapsed.

+20 −0

File changed.

Preview size limit exceeded, changes collapsed.

+9 −0
Original line number Diff line number Diff line
@@ -4836,6 +4836,15 @@ public abstract class Context {
    @SuppressLint("ServiceName")  // TODO: This should be renamed to POWER_WHITELIST_SERVICE
    public static final String POWER_WHITELIST_MANAGER = "power_whitelist";

    /**
     * System service name for the PowerExemptionManager.
     *
     * @see #getSystemService(String)
     * @hide
     */
    @SystemApi
    public static final String POWER_EXEMPTION_SERVICE = "power_exemption";

    /**
     * Use with {@link #getSystemService(String)} to retrieve a
     * {@link android.app.admin.DevicePolicyManager} for working with global