Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e4452b2 authored by Eric Holk's avatar Eric Holk
Browse files

Add getPackageIntentForSender benchmark

ActivityManagerService.getPackageForIntentSender is the second most common
binder transaction during an MPTS run.

Change-Id: I628857d9f323102db3d66da0311f36554cbd797b
parent c62b083f
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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();
        });
    }

    /**