Loading apex/jobscheduler/framework/java/android/os/PowerExemptionManager.java +7 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,12 @@ public class PowerExemptionManager { public @interface AllowListEvent { } /** * Does not place the app on any temporary allow list. Nullifies the previous call to * {@link android.app.BroadcastOptions#setTemporaryAppAllowlist(long, int, int, String)}. * Note: this will not remove the receiver app from the temp allow list. */ public static final int TEMPORARY_ALLOW_LIST_TYPE_NONE = -1; /** * Allow the temp allow list behavior, plus allow foreground service start from background. */ Loading @@ -96,6 +102,7 @@ public class PowerExemptionManager { * @hide */ @IntDef(flag = true, prefix = { "TEMPORARY_ALLOW_LIST_TYPE_" }, value = { TEMPORARY_ALLOW_LIST_TYPE_NONE, TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_ALLOWED, TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_NOT_ALLOWED, }) Loading apex/jobscheduler/framework/java/com/android/server/DeviceIdleInternal.java +4 −4 Original line number Diff line number Diff line Loading @@ -17,9 +17,9 @@ package com.android.server; import android.annotation.Nullable; import android.os.PowerWhitelistManager; import android.os.PowerWhitelistManager.ReasonCode; import android.os.PowerWhitelistManager.TempAllowListType; import android.os.PowerExemptionManager; import android.os.PowerExemptionManager.ReasonCode; import android.os.PowerExemptionManager.TempAllowListType; import com.android.server.deviceidle.IDeviceIdleConstraint; Loading @@ -35,7 +35,7 @@ public interface DeviceIdleInternal { /** * Same as {@link #addPowerSaveTempWhitelistApp(int, String, long, int, boolean, int, String)} * with {@link PowerWhitelistManager#TEMPORARY_ALLOWLIST_TYPE_FOREGROUND_SERVICE_ALLOWED}. * with {@link PowerExemptionManager#TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_ALLOWED}. */ void addPowerSaveTempWhitelistApp(int callingUid, String packageName, long durationMs, int userId, boolean sync, @ReasonCode int reasonCode, Loading apex/jobscheduler/service/java/com/android/server/DeviceIdleController.java +7 −7 Original line number Diff line number Diff line Loading @@ -16,9 +16,9 @@ package com.android.server; import static android.os.PowerWhitelistManager.REASON_SHELL; import static android.os.PowerWhitelistManager.REASON_UNKNOWN; import static android.os.PowerWhitelistManager.TEMPORARY_ALLOWLIST_TYPE_FOREGROUND_SERVICE_ALLOWED; import static android.os.PowerExemptionManager.REASON_SHELL; import static android.os.PowerExemptionManager.REASON_UNKNOWN; import static android.os.PowerExemptionManager.TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_ALLOWED; import static android.os.Process.INVALID_UID; import android.Manifest; Loading Loading @@ -58,11 +58,11 @@ import android.os.Handler; import android.os.IDeviceIdleController; import android.os.Looper; import android.os.Message; import android.os.PowerExemptionManager.ReasonCode; import android.os.PowerExemptionManager.TempAllowListType; import android.os.PowerManager; import android.os.PowerManager.ServiceType; import android.os.PowerManagerInternal; import android.os.PowerWhitelistManager.ReasonCode; import android.os.PowerWhitelistManager.TempAllowListType; import android.os.Process; import android.os.RemoteException; import android.os.ResultReceiver; Loading Loading @@ -1947,7 +1947,7 @@ public class DeviceIdleController extends SystemService long durationMs, int userId, boolean sync, @ReasonCode int reasonCode, @Nullable String reason) { addPowerSaveTempAllowlistAppInternal(callingUid, packageName, durationMs, TEMPORARY_ALLOWLIST_TYPE_FOREGROUND_SERVICE_ALLOWED, TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_ALLOWED, userId, sync, reasonCode, reason); } Loading Loading @@ -2706,7 +2706,7 @@ public class DeviceIdleController extends SystemService final long token = Binder.clearCallingIdentity(); try { addPowerSaveTempAllowlistAppInternal(callingUid, packageName, duration, TEMPORARY_ALLOWLIST_TYPE_FOREGROUND_SERVICE_ALLOWED, packageName, duration, TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_ALLOWED, userId, true, reasonCode, reason); } finally { Binder.restoreCallingIdentity(token); Loading core/api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -8336,6 +8336,7 @@ package android.os { field public static final int REASON_UNKNOWN = 0; // 0x0 field public static final int TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_ALLOWED = 0; // 0x0 field public static final int TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_NOT_ALLOWED = 1; // 0x1 field public static final int TEMPORARY_ALLOW_LIST_TYPE_NONE = -1; // 0xffffffff } public final class PowerManager { core/api/test-current.txt +8 −0 Original line number Diff line number Diff line Loading @@ -253,6 +253,14 @@ package android.app { method public void offsetBeginAndEndTime(long); } public class BroadcastOptions { ctor public BroadcastOptions(@NonNull android.os.Bundle); method public long getTemporaryAppAllowlistDuration(); method @Nullable public String getTemporaryAppAllowlistReason(); method public int getTemporaryAppAllowlistReasonCode(); method public int getTemporaryAppAllowlistType(); } public class DownloadManager { field public static final String COLUMN_MEDIASTORE_URI = "mediastore_uri"; } Loading Loading
apex/jobscheduler/framework/java/android/os/PowerExemptionManager.java +7 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,12 @@ public class PowerExemptionManager { public @interface AllowListEvent { } /** * Does not place the app on any temporary allow list. Nullifies the previous call to * {@link android.app.BroadcastOptions#setTemporaryAppAllowlist(long, int, int, String)}. * Note: this will not remove the receiver app from the temp allow list. */ public static final int TEMPORARY_ALLOW_LIST_TYPE_NONE = -1; /** * Allow the temp allow list behavior, plus allow foreground service start from background. */ Loading @@ -96,6 +102,7 @@ public class PowerExemptionManager { * @hide */ @IntDef(flag = true, prefix = { "TEMPORARY_ALLOW_LIST_TYPE_" }, value = { TEMPORARY_ALLOW_LIST_TYPE_NONE, TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_ALLOWED, TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_NOT_ALLOWED, }) Loading
apex/jobscheduler/framework/java/com/android/server/DeviceIdleInternal.java +4 −4 Original line number Diff line number Diff line Loading @@ -17,9 +17,9 @@ package com.android.server; import android.annotation.Nullable; import android.os.PowerWhitelistManager; import android.os.PowerWhitelistManager.ReasonCode; import android.os.PowerWhitelistManager.TempAllowListType; import android.os.PowerExemptionManager; import android.os.PowerExemptionManager.ReasonCode; import android.os.PowerExemptionManager.TempAllowListType; import com.android.server.deviceidle.IDeviceIdleConstraint; Loading @@ -35,7 +35,7 @@ public interface DeviceIdleInternal { /** * Same as {@link #addPowerSaveTempWhitelistApp(int, String, long, int, boolean, int, String)} * with {@link PowerWhitelistManager#TEMPORARY_ALLOWLIST_TYPE_FOREGROUND_SERVICE_ALLOWED}. * with {@link PowerExemptionManager#TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_ALLOWED}. */ void addPowerSaveTempWhitelistApp(int callingUid, String packageName, long durationMs, int userId, boolean sync, @ReasonCode int reasonCode, Loading
apex/jobscheduler/service/java/com/android/server/DeviceIdleController.java +7 −7 Original line number Diff line number Diff line Loading @@ -16,9 +16,9 @@ package com.android.server; import static android.os.PowerWhitelistManager.REASON_SHELL; import static android.os.PowerWhitelistManager.REASON_UNKNOWN; import static android.os.PowerWhitelistManager.TEMPORARY_ALLOWLIST_TYPE_FOREGROUND_SERVICE_ALLOWED; import static android.os.PowerExemptionManager.REASON_SHELL; import static android.os.PowerExemptionManager.REASON_UNKNOWN; import static android.os.PowerExemptionManager.TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_ALLOWED; import static android.os.Process.INVALID_UID; import android.Manifest; Loading Loading @@ -58,11 +58,11 @@ import android.os.Handler; import android.os.IDeviceIdleController; import android.os.Looper; import android.os.Message; import android.os.PowerExemptionManager.ReasonCode; import android.os.PowerExemptionManager.TempAllowListType; import android.os.PowerManager; import android.os.PowerManager.ServiceType; import android.os.PowerManagerInternal; import android.os.PowerWhitelistManager.ReasonCode; import android.os.PowerWhitelistManager.TempAllowListType; import android.os.Process; import android.os.RemoteException; import android.os.ResultReceiver; Loading Loading @@ -1947,7 +1947,7 @@ public class DeviceIdleController extends SystemService long durationMs, int userId, boolean sync, @ReasonCode int reasonCode, @Nullable String reason) { addPowerSaveTempAllowlistAppInternal(callingUid, packageName, durationMs, TEMPORARY_ALLOWLIST_TYPE_FOREGROUND_SERVICE_ALLOWED, TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_ALLOWED, userId, sync, reasonCode, reason); } Loading Loading @@ -2706,7 +2706,7 @@ public class DeviceIdleController extends SystemService final long token = Binder.clearCallingIdentity(); try { addPowerSaveTempAllowlistAppInternal(callingUid, packageName, duration, TEMPORARY_ALLOWLIST_TYPE_FOREGROUND_SERVICE_ALLOWED, packageName, duration, TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_ALLOWED, userId, true, reasonCode, reason); } finally { Binder.restoreCallingIdentity(token); Loading
core/api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -8336,6 +8336,7 @@ package android.os { field public static final int REASON_UNKNOWN = 0; // 0x0 field public static final int TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_ALLOWED = 0; // 0x0 field public static final int TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_NOT_ALLOWED = 1; // 0x1 field public static final int TEMPORARY_ALLOW_LIST_TYPE_NONE = -1; // 0xffffffff } public final class PowerManager {
core/api/test-current.txt +8 −0 Original line number Diff line number Diff line Loading @@ -253,6 +253,14 @@ package android.app { method public void offsetBeginAndEndTime(long); } public class BroadcastOptions { ctor public BroadcastOptions(@NonNull android.os.Bundle); method public long getTemporaryAppAllowlistDuration(); method @Nullable public String getTemporaryAppAllowlistReason(); method public int getTemporaryAppAllowlistReasonCode(); method public int getTemporaryAppAllowlistType(); } public class DownloadManager { field public static final String COLUMN_MEDIASTORE_URI = "mediastore_uri"; } Loading