Loading AconfigFlags.bp +8 −0 Original line number Diff line number Diff line Loading @@ -1043,11 +1043,19 @@ aconfig_declarations { name: "device_policy_aconfig_flags", package: "android.app.admin.flags", container: "system", exportable: true, srcs: [ "core/java/android/app/admin/flags/flags.aconfig", ], } java_aconfig_library { name: "device_policy_exported_aconfig_flags_lib", aconfig_declarations: "device_policy_aconfig_flags", defaults: ["framework-minus-apex-aconfig-java-defaults"], mode: "exported", } java_aconfig_library { name: "device_policy_aconfig_flags_lib", aconfig_declarations: "device_policy_aconfig_flags", Loading core/java/android/app/ActivityManager.java +34 −2 Original line number Diff line number Diff line Loading @@ -6257,6 +6257,29 @@ public class ActivityManager { * {@link #RESTRICTION_LEVEL_ADAPTIVE} is a normal state, where there is default lifecycle * management applied to the app. Also, {@link #RESTRICTION_LEVEL_EXEMPTED} is used when the * app is being put in a power-save allowlist. * <p> * Example arguments when user force-stops an app from Settings: * <pre> * noteAppRestrictionEnabled( * "com.example.app", * appUid, * RESTRICTION_LEVEL_FORCE_STOPPED, * true, * RESTRICTION_REASON_USER, * "settings", * 0); * </pre> * Example arguments when app is put in restricted standby bucket for exceeding X hours of jobs: * <pre> * noteAppRestrictionEnabled( * "com.example.app", * appUid, * RESTRICTION_LEVEL_RESTRICTED_BUCKET, * true, * RESTRICTION_REASON_SYSTEM_HEALTH, * "job_duration", * X * 3600 * 1000L); * </pre> * * @param packageName the package name of the app * @param uid the uid of the app Loading @@ -6264,11 +6287,20 @@ public class ActivityManager { * @param enabled whether the state is being applied or removed * @param reason the reason for the restriction state change, from {@code RestrictionReason} * @param subReason a string sub reason limited to 16 characters that specifies additional * information about the reason for restriction. * information about the reason for restriction. This string must only contain * reasons related to excessive system resource usage or in some cases, * source of the restriction. This string must not contain any details that * identify user behavior beyond their actions to restrict/unrestrict/launch * apps in some way. * Examples of system resource usage: wakelock, wakeups, mobile_data, * binder_calls, memory, excessive_threads, excessive_cpu, gps_scans, etc. * Examples of user actions: settings, notification, command_line, launch, etc. * * @param threshold for reasons that are due to exceeding some threshold, the threshold value * must be specified. The unit of the threshold depends on the reason and/or * subReason. For time, use milliseconds. For memory, use KB. For count, use * the actual count or normalized as per-hour. For power, use milliwatts. Etc. * the actual count or if rate limited, normalized per-hour. For power, * use milliwatts. For CPU, use mcycles. * * @hide */ Loading core/java/android/app/ActivityManagerInternal.java +12 −0 Original line number Diff line number Diff line Loading @@ -1270,4 +1270,16 @@ public abstract class ActivityManagerInternal { * @hide */ public abstract boolean shouldDelayHomeLaunch(int userId); /** * Add a startup timestamp to the most recent start of the specified process. * * @param key The {@link ApplicationStartInfo} start timestamp key of the timestamp to add. * @param timestampNs The clock monotonic timestamp to add in nanoseconds. * @param uid The UID of the process to add this timestamp to. * @param pid The process id of the process to add this timestamp to. * @param userId The userId in the multi-user environment. */ public abstract void addStartInfoTimestamp(int key, long timestampNs, int uid, int pid, int userId); } core/java/android/app/ITaskStackListener.aidl +5 −0 Original line number Diff line number Diff line Loading @@ -144,6 +144,11 @@ oneway interface ITaskStackListener { */ void onTaskSnapshotChanged(int taskId, in TaskSnapshot snapshot); /** * Called when a task snapshot become invalidated. */ void onTaskSnapshotInvalidated(int taskId); /** * Reports that an Activity received a back key press when there were no additional activities * on the back stack. Loading core/java/android/app/TaskStackListener.java +3 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,9 @@ public abstract class TaskStackListener extends ITaskStackListener.Stub { } } @Override public void onTaskSnapshotInvalidated(int taskId) { } @Override public void onBackPressedOnTaskRoot(RunningTaskInfo taskInfo) throws RemoteException { Loading Loading
AconfigFlags.bp +8 −0 Original line number Diff line number Diff line Loading @@ -1043,11 +1043,19 @@ aconfig_declarations { name: "device_policy_aconfig_flags", package: "android.app.admin.flags", container: "system", exportable: true, srcs: [ "core/java/android/app/admin/flags/flags.aconfig", ], } java_aconfig_library { name: "device_policy_exported_aconfig_flags_lib", aconfig_declarations: "device_policy_aconfig_flags", defaults: ["framework-minus-apex-aconfig-java-defaults"], mode: "exported", } java_aconfig_library { name: "device_policy_aconfig_flags_lib", aconfig_declarations: "device_policy_aconfig_flags", Loading
core/java/android/app/ActivityManager.java +34 −2 Original line number Diff line number Diff line Loading @@ -6257,6 +6257,29 @@ public class ActivityManager { * {@link #RESTRICTION_LEVEL_ADAPTIVE} is a normal state, where there is default lifecycle * management applied to the app. Also, {@link #RESTRICTION_LEVEL_EXEMPTED} is used when the * app is being put in a power-save allowlist. * <p> * Example arguments when user force-stops an app from Settings: * <pre> * noteAppRestrictionEnabled( * "com.example.app", * appUid, * RESTRICTION_LEVEL_FORCE_STOPPED, * true, * RESTRICTION_REASON_USER, * "settings", * 0); * </pre> * Example arguments when app is put in restricted standby bucket for exceeding X hours of jobs: * <pre> * noteAppRestrictionEnabled( * "com.example.app", * appUid, * RESTRICTION_LEVEL_RESTRICTED_BUCKET, * true, * RESTRICTION_REASON_SYSTEM_HEALTH, * "job_duration", * X * 3600 * 1000L); * </pre> * * @param packageName the package name of the app * @param uid the uid of the app Loading @@ -6264,11 +6287,20 @@ public class ActivityManager { * @param enabled whether the state is being applied or removed * @param reason the reason for the restriction state change, from {@code RestrictionReason} * @param subReason a string sub reason limited to 16 characters that specifies additional * information about the reason for restriction. * information about the reason for restriction. This string must only contain * reasons related to excessive system resource usage or in some cases, * source of the restriction. This string must not contain any details that * identify user behavior beyond their actions to restrict/unrestrict/launch * apps in some way. * Examples of system resource usage: wakelock, wakeups, mobile_data, * binder_calls, memory, excessive_threads, excessive_cpu, gps_scans, etc. * Examples of user actions: settings, notification, command_line, launch, etc. * * @param threshold for reasons that are due to exceeding some threshold, the threshold value * must be specified. The unit of the threshold depends on the reason and/or * subReason. For time, use milliseconds. For memory, use KB. For count, use * the actual count or normalized as per-hour. For power, use milliwatts. Etc. * the actual count or if rate limited, normalized per-hour. For power, * use milliwatts. For CPU, use mcycles. * * @hide */ Loading
core/java/android/app/ActivityManagerInternal.java +12 −0 Original line number Diff line number Diff line Loading @@ -1270,4 +1270,16 @@ public abstract class ActivityManagerInternal { * @hide */ public abstract boolean shouldDelayHomeLaunch(int userId); /** * Add a startup timestamp to the most recent start of the specified process. * * @param key The {@link ApplicationStartInfo} start timestamp key of the timestamp to add. * @param timestampNs The clock monotonic timestamp to add in nanoseconds. * @param uid The UID of the process to add this timestamp to. * @param pid The process id of the process to add this timestamp to. * @param userId The userId in the multi-user environment. */ public abstract void addStartInfoTimestamp(int key, long timestampNs, int uid, int pid, int userId); }
core/java/android/app/ITaskStackListener.aidl +5 −0 Original line number Diff line number Diff line Loading @@ -144,6 +144,11 @@ oneway interface ITaskStackListener { */ void onTaskSnapshotChanged(int taskId, in TaskSnapshot snapshot); /** * Called when a task snapshot become invalidated. */ void onTaskSnapshotInvalidated(int taskId); /** * Reports that an Activity received a back key press when there were no additional activities * on the back stack. Loading
core/java/android/app/TaskStackListener.java +3 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,9 @@ public abstract class TaskStackListener extends ITaskStackListener.Stub { } } @Override public void onTaskSnapshotInvalidated(int taskId) { } @Override public void onBackPressedOnTaskRoot(RunningTaskInfo taskInfo) throws RemoteException { Loading