OSDN Git Service

Add SystemApis to expose runtime profile information
authorCalin Juravle <calin@google.com>
Wed, 8 Nov 2017 02:49:43 +0000 (18:49 -0800)
committerCalin Juravle <calin@google.com>
Mon, 4 Dec 2017 22:26:46 +0000 (14:26 -0800)
commit45f8b29ce0ca9f80c586850c4be3a1e552bc6c2f
tree9913a099ec8f3f38240422d7cfbedef42b509f4b
parent71e9a56fc30d66ad6d475fbf26425d791c2befa2
Add SystemApis to expose runtime profile information

The API allows a system apps which acquired
{@code android.permission.READ_RUNTIME_PROFILE} to snapshot the runtime
profiles of installed packages.

The API is implemented in a new service class (AndroidRuntimeManager)
accessible from the context using
context().getPackageManager().getAndroidRuntimeManager().

The main functionality is exposed as a one way call into the
AndroidRuntimeManager with the result being posted on a callback. The
profile is available to the caller as a read-only ParcelFileDescriptor.

This CL only adds the API interfaces and validation. It does not fully
implement the functionality.

oneway void snapshotRuntimeProfile(in String packageName,
  in String codePath, in ISnapshotRuntimeProfileCallback callback)

Bug: 30934496
Test: gts-tradefed -m GtsAndroidRuntimeManagerHostTestCases

Change-Id: Iaa6be4715840f24508acba3162ea9c1ab725bd38
12 files changed:
Android.bp
api/system-current.txt
core/java/android/app/ApplicationPackageManager.java
core/java/android/content/pm/IPackageManager.aidl
core/java/android/content/pm/PackageManager.java
core/java/android/content/pm/dex/ArtManager.java [new file with mode: 0644]
core/java/android/content/pm/dex/IArtManager.aidl [new file with mode: 0644]
core/java/android/content/pm/dex/ISnapshotRuntimeProfileCallback.aidl [new file with mode: 0644]
core/res/AndroidManifest.xml
services/core/java/com/android/server/pm/PackageManagerService.java
services/core/java/com/android/server/pm/dex/ArtManagerService.java [new file with mode: 0644]
test-mock/src/android/test/mock/MockPackageManager.java