Loading startop/apps/test/AndroidManifest.xml +2 −0 Original line number Diff line number Diff line Loading @@ -91,4 +91,6 @@ </application> <uses-permission android:name="android.permission.WAKE_LOCK" /> </manifest> startop/apps/test/src/SystemServerBenchmarks.java +10 −2 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.os.AsyncTask; import android.os.PowerManager; /** * An interface for running benchmarks and collecting results. Used so we can have both an Loading Loading @@ -167,6 +168,13 @@ class SystemServerBenchmarks { benchmarks.addBenchmark("getPackageIntentForSender", () -> { pi.getCreatorPackage(); }); PowerManager pwr = (PowerManager) parent.getSystemService(Context.POWER_SERVICE); PowerManager.WakeLock wl = pwr.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "benchmark tag"); benchmarks.addBenchmark("WakeLock Acquire/Release", () -> { wl.acquire(); wl.release(); }); } /** Loading Loading
startop/apps/test/AndroidManifest.xml +2 −0 Original line number Diff line number Diff line Loading @@ -91,4 +91,6 @@ </application> <uses-permission android:name="android.permission.WAKE_LOCK" /> </manifest>
startop/apps/test/src/SystemServerBenchmarks.java +10 −2 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.os.AsyncTask; import android.os.PowerManager; /** * An interface for running benchmarks and collecting results. Used so we can have both an Loading Loading @@ -167,6 +168,13 @@ class SystemServerBenchmarks { benchmarks.addBenchmark("getPackageIntentForSender", () -> { pi.getCreatorPackage(); }); PowerManager pwr = (PowerManager) parent.getSystemService(Context.POWER_SERVICE); PowerManager.WakeLock wl = pwr.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "benchmark tag"); benchmarks.addBenchmark("WakeLock Acquire/Release", () -> { wl.acquire(); wl.release(); }); } /** Loading