From 71750b2229e5b0afa3236e16cdf272d3ff01c813 Mon Sep 17 00:00:00 2001 From: Marco Ballesio Date: Thu, 12 Mar 2020 09:32:41 -0700 Subject: freezer: thaw on dumpsys data collection Introduce a new java API wrapping libprocessgroup to thaw and freeze again the freezer. Use such API in ActivityManager upon collection of sensitive dumpsys fields. Bug: 151225245 Test: manually verified that the freezer is thawed and then frozen again for meminfo, dbinfo and gfxinfo. Verified that data collection does not timeout when this API is called Change-Id: I487f328cb05ceac2fa2f23ad94ca8d4f82b82a5a --- core/java/android/os/Process.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'core/java/android/os/Process.java') diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java index d7af1b9faa97..a37dd7dfc135 100644 --- a/core/java/android/os/Process.java +++ b/core/java/android/os/Process.java @@ -928,6 +928,19 @@ public class Process { */ public static final native void setProcessFrozen(int pid, int uid, boolean frozen); + /** + * Enable or disable the freezer. When enable == false all frozen processes are unfrozen, + * but aren't removed from the freezer. Processes can still be added or removed + * by using setProcessFrozen, but they won't actually be frozen until the freezer is enabled + * again. If enable == true the freezer is enabled again, and all processes + * in the freezer (including the ones added while the freezer was disabled) are frozen. + * + * @param enable Specify whether to enable (true) or disable (false) the freezer. + * + * @hide + */ + public static final native void enableFreezer(boolean enable); + /** * Return the scheduling group of requested process. * -- cgit v1.2.3