# FakeHost

Artifact: [androidx.car.app:app-testing](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/testing/FakeHost.java+class:androidx.car.app.testing.FakeHost) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)

*** ** * ** ***


```
public class FakeHost
```

<br />

*** ** * ** ***

A fake that simulates the behavior of the host of a car app.

This fake allows sending a `https://developer.android.com/reference/android/app/PendingIntent.html` as if the user clicked on a notification action.

It will also perform expected host behaviors such as calling `https://developer.android.com/reference/androidx/car/app/Screen#onGetTemplate()` after `https://developer.android.com/reference/androidx/car/app/AppManager#invalidate()` is called.

## Summary

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/car/app/testing/FakeHost#performNotificationActionClick(android.app.PendingIntent)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html pendingIntent)` Sends the given pending intent as if the user clicked on a notification action. |
| `void` | `https://developer.android.com/reference/androidx/car/app/testing/FakeHost#setMicrophoneInputData(java.io.InputStream)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/io/InputStream.html inputStream)` Sets an `https://developer.android.com/reference/java/io/InputStream.html` to use as the source for microphone data input. |

## Public methods

### performNotificationActionClick

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)

```
public void performNotificationActionClick(@NonNull PendingIntent pendingIntent)
```

Sends the given pending intent as if the user clicked on a notification action.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException.html` | if `pendingIntent` is `null` |

### setMicrophoneInputData

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
public void setMicrophoneInputData(@NonNull InputStream inputStream)
```

Sets an `https://developer.android.com/reference/java/io/InputStream.html` to use as the source for microphone data input.