# ProfileInstallReceiver

Artifact: [androidx.profileinstaller:profileinstaller](https://developer.android.com/jetpack/androidx/releases/profileinstaller) [View Source](https://cs.android.com/search?q=file:androidx/profileinstaller/ProfileInstallReceiver.java+class:androidx.profileinstaller.ProfileInstallReceiver) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/profileinstaller#1.0.0)

*** ** * ** ***


```
public class ProfileInstallReceiver extends BroadcastReceiver
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [android.content.BroadcastReceiver](https://developer.android.com/reference/android/content/BroadcastReceiver.html) ||
|   | ↳ | [androidx.profileinstaller.ProfileInstallReceiver](https://developer.android.com/reference/androidx/profileinstaller/ProfileInstallReceiver) |

*** ** * ** ***

The `https://developer.android.com/reference/android/content/BroadcastReceiver.html` 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 @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/profileinstaller/ProfileInstallReceiver#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 @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/profileinstaller/ProfileInstallReceiver#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 @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/profileinstaller/ProfileInstallReceiver#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 @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/profileinstaller/ProfileInstallReceiver#ACTION_SKIP_FILE() = "androidx.profileinstaller.action.SKIP_FILE"` This is an action constant which requests that `https://developer.android.com/reference/androidx/profileinstaller/ProfileInstaller` manipulate the skip file used during profile installation. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/profileinstaller/ProfileInstallReceiver#ProfileInstallReceiver()()` |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/profileinstaller/ProfileInstallReceiver#onReceive(android.content.Context,android.content.Intent)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/content/Intent.html intent)` |

| ### Inherited methods |
|---|
| From [android.content.BroadcastReceiver](https://developer.android.com/reference/android/content/BroadcastReceiver.html) |---|---| | `final void` | `https://developer.android.com/reference/android/content/BroadcastReceiver.html#abortBroadcast()()` | | `final void` | `https://developer.android.com/reference/android/content/BroadcastReceiver.html#clearAbortBroadcast()()` | | `final boolean` | `https://developer.android.com/reference/android/content/BroadcastReceiver.html#getAbortBroadcast()()` | | `final boolean` | `https://developer.android.com/reference/android/content/BroadcastReceiver.html#getDebugUnregister()()` | | `final int` | `https://developer.android.com/reference/android/content/BroadcastReceiver.html#getResultCode()()` | | `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/android/content/BroadcastReceiver.html#getResultData()()` | | `final https://developer.android.com/reference/android/os/Bundle.html` | `https://developer.android.com/reference/android/content/BroadcastReceiver.html#getResultExtras(boolean)(boolean makeMap)` | | `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/android/content/BroadcastReceiver.html#getSentFromPackage()()` | | `int` | `https://developer.android.com/reference/android/content/BroadcastReceiver.html#getSentFromUid()()` | | `final https://developer.android.com/reference/android/content/BroadcastReceiver.PendingResult.html` | `https://developer.android.com/reference/android/content/BroadcastReceiver.html#goAsync()()` | | `final boolean` | `https://developer.android.com/reference/android/content/BroadcastReceiver.html#isInitialStickyBroadcast()()` | | `final boolean` | `https://developer.android.com/reference/android/content/BroadcastReceiver.html#isOrderedBroadcast()()` | | `https://developer.android.com/reference/android/os/IBinder.html` | `https://developer.android.com/reference/android/content/BroadcastReceiver.html#peekService(android.content.Context, android.content.Intent)(https://developer.android.com/reference/android/content/Context.html myContext, https://developer.android.com/reference/android/content/Intent.html service)` | | `final void` | `https://developer.android.com/reference/android/content/BroadcastReceiver.html#setDebugUnregister(boolean)(boolean debug)` | | `final void` | `https://developer.android.com/reference/android/content/BroadcastReceiver.html#setOrderedHint(boolean)(boolean isOrdered)` | | `final void` | `https://developer.android.com/reference/android/content/BroadcastReceiver.html#setResult(int, java.lang.String, android.os.Bundle)(int code, https://developer.android.com/reference/java/lang/String.html data, https://developer.android.com/reference/android/os/Bundle.html extras)` | | `final void` | `https://developer.android.com/reference/android/content/BroadcastReceiver.html#setResultCode(int)(int code)` | | `final void` | `https://developer.android.com/reference/android/content/BroadcastReceiver.html#setResultData(java.lang.String)(https://developer.android.com/reference/java/lang/String.html data)` | | `final void` | `https://developer.android.com/reference/android/content/BroadcastReceiver.html#setResultExtras(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle.html extras)` | |

## Constants

### ACTION_BENCHMARK_OPERATION

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/profileinstaller#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](https://developer.android.com/jetpack/androidx/releases/profileinstaller#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](https://developer.android.com/jetpack/androidx/releases/profileinstaller#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](https://developer.android.com/jetpack/androidx/releases/profileinstaller#1.2.0)

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

This is an action constant which requests that `https://developer.android.com/reference/androidx/profileinstaller/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](https://developer.android.com/jetpack/androidx/releases/profileinstaller#1.0.0)

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