# 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)

*** ** * ** ***


```
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/kotlin/androidx/car/app/Screen#onGetTemplate()` after `https://developer.android.com/reference/kotlin/androidx/car/app/AppManager#invalidate()` is called.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/testing/FakeHost#performNotificationActionClick(android.app.PendingIntent)(pendingIntent: https://developer.android.com/reference/android/app/PendingIntent.html)` Sends the given pending intent as if the user clicked on a notification action. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/testing/FakeHost#setMicrophoneInputData(java.io.InputStream)(inputStream: https://developer.android.com/reference/java/io/InputStream.html)` Sets an `https://developer.android.com/reference/java/io/InputStream.html` to use as the source for microphone data input. |

## Public functions

### performNotificationActionClick

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

```
fun performNotificationActionClick(pendingIntent: PendingIntent): Unit
```

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)

```
fun setMicrophoneInputData(inputStream: InputStream): Unit
```

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