ProfileInstallReceiver

public class ProfileInstallReceiver extends BroadcastReceiver


The android.content.BroadcastReceiver which forces a synchronous installation of the baseline profile. This is primarily used by tools to force a synchronous install of the baseline profile without starting the application's main activity. It is not expected for this receiver to be used at runtime by anything other than tools, and as such, the action filter is defined with the "dump" permission.

Summary

Constants

static final @NonNull String
ACTION_BENCHMARK_OPERATION = "androidx.profileinstaller.action.BENCHMARK_OPERATION"

This is an action that triggers actions required for stable benchmarking from an external tool on user builds, such as clearing the code cache, or triggering garbage collection.

static final @NonNull String
ACTION_INSTALL_PROFILE = "androidx.profileinstaller.action.INSTALL_PROFILE"

This is the action constant that this broadcast receiver responds to and installs a profile.

static final @NonNull String
ACTION_SAVE_PROFILE = "androidx.profileinstaller.action.SAVE_PROFILE"

This is the action constant for saving the current in-memory hot method data to a profile on disk.

static final @NonNull String
ACTION_SKIP_FILE = "androidx.profileinstaller.action.SKIP_FILE"

This is an action constant which requests that ProfileInstaller manipulate the skip file used during profile installation.

Public constructors

Public methods

void
onReceive(@NonNull Context context, @Nullable Intent intent)

Inherited methods

From android.content.BroadcastReceiver
final void
final void
final boolean
final boolean
final int
final String
final Bundle
getResultExtras(boolean makeMap)
String
int
final BroadcastReceiver.PendingResult
final boolean
final boolean
IBinder
peekService(Context myContext, Intent service)
final void
setDebugUnregister(boolean debug)
final void
setOrderedHint(boolean isOrdered)
final void
setResult(int code, String data, Bundle extras)
final void
setResultCode(int code)
final void
final void

Constants

ACTION_BENCHMARK_OPERATION

Added in 1.3.0
public static final @NonNull String ACTION_BENCHMARK_OPERATION = "androidx.profileinstaller.action.BENCHMARK_OPERATION"

This is an action that triggers actions required for stable benchmarking from an external tool on user builds, such as clearing the code cache, or triggering garbage collection.

ACTION_INSTALL_PROFILE

Added in 1.0.0
public static final @NonNull String ACTION_INSTALL_PROFILE = "androidx.profileinstaller.action.INSTALL_PROFILE"

This is the action constant that this broadcast receiver responds to and installs a profile.

ACTION_SAVE_PROFILE

Added in 1.3.0
public static final @NonNull String ACTION_SAVE_PROFILE = "androidx.profileinstaller.action.SAVE_PROFILE"

This is the action constant for saving the current in-memory hot method data to a profile on disk. This is to be used with compilation:

cmd package compile -f -m speed-profile myPackageName

And with profile extraction (API33+):

pm dump-profiles --dump-classes-and-methods

ACTION_SKIP_FILE

Added in 1.2.0
public static final @NonNull String ACTION_SKIP_FILE = "androidx.profileinstaller.action.SKIP_FILE"

This is an action constant which requests that ProfileInstaller manipulate the skip file used during profile installation. This is only useful when the app is being instrumented when using Jetpack Macrobenchmarks.

Public constructors

ProfileInstallReceiver

Added in 1.0.0
public ProfileInstallReceiver()

Public methods

onReceive

Added in 1.0.0
public void onReceive(@NonNull Context context, @Nullable Intent intent)