diff options
| author | Marco Ballesio <balejs@google.com> | 2020-01-23 13:57:00 -0800 |
|---|---|---|
| committer | Marco Ballesio <balejs@google.com> | 2020-01-24 15:08:01 -0800 |
| commit | bdaf16e72aedf06f007c1a8b288c68ee470277d1 (patch) | |
| tree | 08f51411efb0e56039e1a1afc2321b0d47716a9e /core/java/android/os/Process.java | |
| parent | 069dc4277ee3336d6487c387f7def9cd9489defd (diff) | |
Add support for freezing cached apps
Freeze apps when cached and unfreeze them once removed from the cache or
killed. Frozen apps will not use any CPU cycles, reducing power
consumption for misbehaving processes which might attempt to run
while cached.
Change-Id: Ib055352062825db62927015c33ee0a285aa4630c
Depends-On: pa/1495867, ag/9976279, ag/9981529, ag/9987868¬
Bug: 143308662
Test: manual, atest CachedAppOptimizerTest
Diffstat (limited to 'core/java/android/os/Process.java')
| -rw-r--r-- | core/java/android/os/Process.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java index c7a8474c8038..0f11d48b595a 100644 --- a/core/java/android/os/Process.java +++ b/core/java/android/os/Process.java @@ -856,6 +856,17 @@ public class Process { throws IllegalArgumentException, SecurityException; /** + * Freeze or unfreeze the specified process. + * + * @param pid Identifier of the process to freeze or unfreeze. + * @param uid Identifier of the user the process is running under. + * @param frozen Specify whether to free (true) or unfreeze (false). + * + * @hide + */ + public static final native void setProcessFrozen(int pid, int uid, boolean frozen); + + /** * Return the scheduling group of requested process. * * @hide |
