Loading apex/jobscheduler/framework/java/android/os/PowerExemptionManager.java +6 −0 Original line number Diff line number Diff line Loading @@ -344,6 +344,9 @@ public class PowerExemptionManager { */ public static final int REASON_MEDIA_SESSION_CALLBACK = 317; /** @hide The app requests out-out. */ public static final int REASON_OPT_OUT_REQUESTED = 1000; /** * The list of BG-FGS-Launch and temp-allow-list reason code. * @hide Loading Loading @@ -411,6 +414,7 @@ public class PowerExemptionManager { REASON_EVENT_MMS, REASON_SHELL, REASON_MEDIA_SESSION_CALLBACK, REASON_OPT_OUT_REQUESTED, }) @Retention(RetentionPolicy.SOURCE) public @interface ReasonCode {} Loading Loading @@ -709,6 +713,8 @@ public class PowerExemptionManager { return "SHELL"; case REASON_MEDIA_SESSION_CALLBACK: return "MEDIA_SESSION_CALLBACK"; case REASON_OPT_OUT_REQUESTED: return "REASON_OPT_OUT_REQUESTED"; default: return "(unknown:" + reasonCode + ")"; } Loading core/api/test-current.txt +5 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,10 @@ package android { field public static final String UNDEFINED = "android.permission-group.UNDEFINED"; } public static final class R.attr { field public static final int requestForegroundServiceExemption; } public static final class R.bool { field public static final int config_assistantOnTopOfDream = 17891333; // 0x1110005 field public static final int config_perDisplayFocusEnabled = 17891332; // 0x1110004 Loading Loading @@ -806,6 +810,7 @@ package android.content.pm { } public class ApplicationInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable { method public boolean hasRequestForegroundServiceExemption(); method public boolean isPrivilegedApp(); method public boolean isSystemApp(); field public static final int PRIVATE_FLAG_PRIVILEGED = 8; // 0x8 Loading core/java/android/content/pm/ApplicationInfo.java +20 −0 Original line number Diff line number Diff line Loading @@ -778,9 +778,18 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { */ public static final int PRIVATE_FLAG_EXT_PROFILEABLE = 1 << 0; /** * Value for {@link #privateFlagsExt}: whether this application has requested * exemption from the foreground service restriction introduced in S * (https://developer.android.com/about/versions/12/foreground-services). * @hide */ public static final int PRIVATE_FLAG_EXT_REQUEST_FOREGROUND_SERVICE_EXEMPTION = 1 << 1; /** @hide */ @IntDef(flag = true, prefix = { "PRIVATE_FLAG_EXT_" }, value = { PRIVATE_FLAG_EXT_PROFILEABLE, PRIVATE_FLAG_EXT_REQUEST_FOREGROUND_SERVICE_EXEMPTION, }) @Retention(RetentionPolicy.SOURCE) public @interface ApplicationInfoPrivateFlagsExt {} Loading Loading @@ -2444,6 +2453,17 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { return (privateFlags & ApplicationInfo.PRIVATE_FLAG_IS_RESOURCE_OVERLAY) != 0; } /** * @return whether the app has requested exemption from the foreground service restrictions. * This does not take any affect for now. * @hide */ @TestApi public boolean hasRequestForegroundServiceExemption() { return (privateFlagsExt & ApplicationInfo.PRIVATE_FLAG_EXT_REQUEST_FOREGROUND_SERVICE_EXEMPTION) != 0; } /** * @hide */ Loading core/java/android/content/pm/parsing/PackageInfoWithoutStateUtils.java +3 −1 Original line number Diff line number Diff line Loading @@ -806,7 +806,9 @@ public class PackageInfoWithoutStateUtils { public static int appInfoPrivateFlagsExt(ParsingPackageRead pkg) { // @formatter:off int privateFlagsExt = flag(pkg.isProfileable(), ApplicationInfo.PRIVATE_FLAG_EXT_PROFILEABLE); flag(pkg.isProfileable(), ApplicationInfo.PRIVATE_FLAG_EXT_PROFILEABLE) | flag(pkg.hasRequestForegroundServiceExemption(), ApplicationInfo.PRIVATE_FLAG_EXT_REQUEST_FOREGROUND_SERVICE_EXEMPTION); // @formatter:on return privateFlagsExt; } Loading core/java/android/content/pm/parsing/ParsingPackage.java +2 −0 Original line number Diff line number Diff line Loading @@ -338,6 +338,8 @@ public interface ParsingPackage extends ParsingPackageRead { ParsingPackage setTheme(int theme); ParsingPackage setRequestForegroundServiceExemption(boolean requestForegroundServiceExemption); ParsingPackage setUpgradeKeySets(@NonNull Set<String> upgradeKeySets); ParsingPackage setUse32BitAbi(boolean use32BitAbi); Loading Loading
apex/jobscheduler/framework/java/android/os/PowerExemptionManager.java +6 −0 Original line number Diff line number Diff line Loading @@ -344,6 +344,9 @@ public class PowerExemptionManager { */ public static final int REASON_MEDIA_SESSION_CALLBACK = 317; /** @hide The app requests out-out. */ public static final int REASON_OPT_OUT_REQUESTED = 1000; /** * The list of BG-FGS-Launch and temp-allow-list reason code. * @hide Loading Loading @@ -411,6 +414,7 @@ public class PowerExemptionManager { REASON_EVENT_MMS, REASON_SHELL, REASON_MEDIA_SESSION_CALLBACK, REASON_OPT_OUT_REQUESTED, }) @Retention(RetentionPolicy.SOURCE) public @interface ReasonCode {} Loading Loading @@ -709,6 +713,8 @@ public class PowerExemptionManager { return "SHELL"; case REASON_MEDIA_SESSION_CALLBACK: return "MEDIA_SESSION_CALLBACK"; case REASON_OPT_OUT_REQUESTED: return "REASON_OPT_OUT_REQUESTED"; default: return "(unknown:" + reasonCode + ")"; } Loading
core/api/test-current.txt +5 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,10 @@ package android { field public static final String UNDEFINED = "android.permission-group.UNDEFINED"; } public static final class R.attr { field public static final int requestForegroundServiceExemption; } public static final class R.bool { field public static final int config_assistantOnTopOfDream = 17891333; // 0x1110005 field public static final int config_perDisplayFocusEnabled = 17891332; // 0x1110004 Loading Loading @@ -806,6 +810,7 @@ package android.content.pm { } public class ApplicationInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable { method public boolean hasRequestForegroundServiceExemption(); method public boolean isPrivilegedApp(); method public boolean isSystemApp(); field public static final int PRIVATE_FLAG_PRIVILEGED = 8; // 0x8 Loading
core/java/android/content/pm/ApplicationInfo.java +20 −0 Original line number Diff line number Diff line Loading @@ -778,9 +778,18 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { */ public static final int PRIVATE_FLAG_EXT_PROFILEABLE = 1 << 0; /** * Value for {@link #privateFlagsExt}: whether this application has requested * exemption from the foreground service restriction introduced in S * (https://developer.android.com/about/versions/12/foreground-services). * @hide */ public static final int PRIVATE_FLAG_EXT_REQUEST_FOREGROUND_SERVICE_EXEMPTION = 1 << 1; /** @hide */ @IntDef(flag = true, prefix = { "PRIVATE_FLAG_EXT_" }, value = { PRIVATE_FLAG_EXT_PROFILEABLE, PRIVATE_FLAG_EXT_REQUEST_FOREGROUND_SERVICE_EXEMPTION, }) @Retention(RetentionPolicy.SOURCE) public @interface ApplicationInfoPrivateFlagsExt {} Loading Loading @@ -2444,6 +2453,17 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { return (privateFlags & ApplicationInfo.PRIVATE_FLAG_IS_RESOURCE_OVERLAY) != 0; } /** * @return whether the app has requested exemption from the foreground service restrictions. * This does not take any affect for now. * @hide */ @TestApi public boolean hasRequestForegroundServiceExemption() { return (privateFlagsExt & ApplicationInfo.PRIVATE_FLAG_EXT_REQUEST_FOREGROUND_SERVICE_EXEMPTION) != 0; } /** * @hide */ Loading
core/java/android/content/pm/parsing/PackageInfoWithoutStateUtils.java +3 −1 Original line number Diff line number Diff line Loading @@ -806,7 +806,9 @@ public class PackageInfoWithoutStateUtils { public static int appInfoPrivateFlagsExt(ParsingPackageRead pkg) { // @formatter:off int privateFlagsExt = flag(pkg.isProfileable(), ApplicationInfo.PRIVATE_FLAG_EXT_PROFILEABLE); flag(pkg.isProfileable(), ApplicationInfo.PRIVATE_FLAG_EXT_PROFILEABLE) | flag(pkg.hasRequestForegroundServiceExemption(), ApplicationInfo.PRIVATE_FLAG_EXT_REQUEST_FOREGROUND_SERVICE_EXEMPTION); // @formatter:on return privateFlagsExt; } Loading
core/java/android/content/pm/parsing/ParsingPackage.java +2 −0 Original line number Diff line number Diff line Loading @@ -338,6 +338,8 @@ public interface ParsingPackage extends ParsingPackageRead { ParsingPackage setTheme(int theme); ParsingPackage setRequestForegroundServiceExemption(boolean requestForegroundServiceExemption); ParsingPackage setUpgradeKeySets(@NonNull Set<String> upgradeKeySets); ParsingPackage setUse32BitAbi(boolean use32BitAbi); Loading