summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorHongming Jin <hongmingjin@google.com>2021-07-30 19:27:29 -0700
committerHongming Jin <hongmingjin@google.com>2021-08-09 12:16:57 -0700
commitf1dd13ba6cf316c634919d1273a6ce6a1c062c97 (patch)
treee79e38b30f88c1b910d7911fca95200b67902fa7 /core/java/android
parent768bdfe990d55536da246dcaaa8d800d229e49d3 (diff)
Add CPU stats into trace.
Bug: 157601519 Test: adb shell cmd accessibility start-trace -t AccessibilityInteractionClient IAccessibilityInteractionConnectionCallback adb shell cmd accessibility stop-trace Change-Id: I765ff5fc4656f0e6c686407d11a596b4e009a8ca
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/app/ActivityManagerInternal.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/java/android/app/ActivityManagerInternal.java b/core/java/android/app/ActivityManagerInternal.java
index 7145c0fe35bf..7c96916c9de1 100644
--- a/core/java/android/app/ActivityManagerInternal.java
+++ b/core/java/android/app/ActivityManagerInternal.java
@@ -36,6 +36,7 @@ import android.os.PowerExemptionManager.TempAllowListType;
import android.os.TransactionTooLargeException;
import android.os.WorkSource;
import android.util.ArraySet;
+import android.util.Pair;
import java.util.ArrayList;
import java.util.List;
@@ -84,6 +85,18 @@ public abstract class ActivityManagerInternal {
public static final int ALLOW_ALL_PROFILE_PERMISSIONS_IN_PROFILE = 3;
/**
+ * Returns profile information in free form string in two separate strings.
+ * See AppProfiler for the output format.
+ * The output can only be used for human consumption. The format may change
+ * in the future.
+ * Do not call it frequently.
+ * @param time uptime for the cpu state
+ * @param lines lines of the cpu state should be returned
+ * @return a pair of Strings. The first is the current cpu load, the second is the cpu state.
+ */
+ public abstract Pair<String, String> getAppProfileStatsForDebugging(long time, int lines);
+
+ /**
* Verify that calling app has access to the given provider.
*/
public abstract String checkContentProviderAccess(String authority, @UserIdInt int userId);