summaryrefslogtreecommitdiff
path: root/startop/apps
diff options
context:
space:
mode:
authorEric Holk <eholk@google.com>2019-10-11 16:42:23 -0700
committerEric Holk <eholk@google.com>2019-10-11 16:42:31 -0700
commit3e4452b2756a6ec0592d4b407dd87b7495293945 (patch)
treeb7033f82e719e26a160bd91781bdeb2be493de85 /startop/apps
parentc62b083fc828c89c7b26d41c5d2ccc620275c264 (diff)
Add getPackageIntentForSender benchmark
ActivityManagerService.getPackageForIntentSender is the second most common binder transaction during an MPTS run. Change-Id: I628857d9f323102db3d66da0311f36554cbd797b
Diffstat (limited to 'startop/apps')
-rw-r--r--startop/apps/test/src/SystemServerBenchmarks.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/startop/apps/test/src/SystemServerBenchmarks.java b/startop/apps/test/src/SystemServerBenchmarks.java
index 7aec1d2c14c7..2464fbf7691c 100644
--- a/startop/apps/test/src/SystemServerBenchmarks.java
+++ b/startop/apps/test/src/SystemServerBenchmarks.java
@@ -18,6 +18,7 @@ package com.android.startop.test;
import android.app.Activity;
import android.app.ActivityManager;
+import android.app.PendingIntent;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -158,6 +159,14 @@ class SystemServerBenchmarks {
benchmarks.addBenchmark("getRunningAppProcesses", () -> {
am.getRunningAppProcesses();
});
+
+ // We use PendingIntent.getCreatorPackage, since
+ // getPackageIntentForSender is not public to us, but getCreatorPackage
+ // is just a thin wrapper around it.
+ PendingIntent pi = PendingIntent.getActivity(parent, 0, new Intent(), 0);
+ benchmarks.addBenchmark("getPackageIntentForSender", () -> {
+ pi.getCreatorPackage();
+ });
}
/**