# CarRemoteAccessManager.RemoteTaskClientCallback

# CarRemoteAccessManager.RemoteTaskClientCallback

`
public
static


interface
CarRemoteAccessManager.RemoteTaskClientCallback
`  
`


`

|--------------------------------------------------------------------------|
| android.car.remoteaccess.CarRemoteAccessManager.RemoteTaskClientCallback |

<br />

*** ** * ** ***

Listener for remote task events.

## Summary

|                                                                                                                                                                                                                                             ### Public methods                                                                                                                                                                                                                                              ||
|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract void` | ` `[onRegistrationFailed](https://developer.android.com/reference/android/car/remoteaccess/CarRemoteAccessManager.RemoteTaskClientCallback#onRegistrationFailed())`() ` This is called when registering the remote task client fails.                                                                                                                                                                                                                                                     |
| ` abstract void` | ` `[onRegistrationUpdated](https://developer.android.com/reference/android/car/remoteaccess/CarRemoteAccessManager.RemoteTaskClientCallback#onRegistrationUpdated(android.car.remoteaccess.RemoteTaskClientRegistrationInfo))`(`[RemoteTaskClientRegistrationInfo](https://developer.android.com/reference/android/car/remoteaccess/RemoteTaskClientRegistrationInfo)` info) ` This is called when the remote task client is successfully registered or the client ID is updated by AAOS. |
| ` abstract void` | ` `[onRemoteTaskRequested](https://developer.android.com/reference/android/car/remoteaccess/CarRemoteAccessManager.RemoteTaskClientCallback#onRemoteTaskRequested(java.lang.String,%20byte[],%20int))`(String taskId, byte[] data, int taskMaxDurationInSec) ` This is called when a wake-up request is received/processed.                                                                                                                                                               |
| ` default void`  | ` `[onServerlessClientRegistered](https://developer.android.com/reference/android/car/remoteaccess/CarRemoteAccessManager.RemoteTaskClientCallback#onServerlessClientRegistered())`() ` This is called when a pre-configured serverless remote task client is registered.                                                                                                                                                                                                                 |
| ` abstract void` | ` `[onShutdownStarting](https://developer.android.com/reference/android/car/remoteaccess/CarRemoteAccessManager.RemoteTaskClientCallback#onShutdownStarting(android.car.remoteaccess.CarRemoteAccessManager.CompletableRemoteTaskFuture))`(`[CarRemoteAccessManager.CompletableRemoteTaskFuture](https://developer.android.com/reference/android/car/remoteaccess/CarRemoteAccessManager.CompletableRemoteTaskFuture)` future) ` This is called when the device is about to shutdown.     |

## Public methods

### onRegistrationFailed

```
public abstract void onRegistrationFailed ()
```

This is called when registering the remote task client fails.

<br />

### onRegistrationUpdated

```
public abstract void onRegistrationUpdated (RemoteTaskClientRegistrationInfo info)
```

This is called when the remote task client is successfully registered or the client ID is updated by AAOS.

For a serverless remote task client, the[ERROR(/onServerlessClientRegistered)](https://developer.android.com/)will be called instead of this.

<br />

|                                                                                                                            Parameters                                                                                                                             ||
|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `info` | `RemoteTaskClientRegistrationInfo`:[RemoteTaskClientRegistrationInfo](https://developer.android.com/reference/android/car/remoteaccess/RemoteTaskClientRegistrationInfo)which contains wake-up service ID, vehicle ID, processor ID and client ID. <br /> |

### onRemoteTaskRequested

```
public abstract void onRemoteTaskRequested (String taskId, 
                byte[] data, 
                int taskMaxDurationInSec)
```

This is called when a wake-up request is received/processed.

<br />

|                                              Parameters                                              ||
|------------------------|------------------------------------------------------------------------------|
| `taskId`               | `String`: ID of the task that is requested by the remote task server. <br /> |
| `data`                 | `byte`: Extra data passed along with the wake-up request. <br />             |
| `taskMaxDurationInSec` | `int`: The timeout before AAOS goes back to the previous power state. <br /> |

### onServerlessClientRegistered

```
public void onServerlessClientRegistered ()
```

This is called when a pre-configured serverless remote task client is registered.

The serverless remote task client is configured via including a runtime config file at`/vendor/etc/`

<br />

### onShutdownStarting

```
public abstract void onShutdownStarting (CarRemoteAccessManager.CompletableRemoteTaskFuture future)
```

This is called when the device is about to shutdown.

The remote task client should finalize the ongoing tasks, if any, and complete the given future within 5 seconds. After the given timeout, the Android system will shutdown, anyway.

<br />

|                                                                                                                                                              Parameters                                                                                                                                                              ||
|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `future` | `CarRemoteAccessManager.CompletableRemoteTaskFuture`:[CompletableRemoteTaskFuture](https://developer.android.com/reference/android/car/remoteaccess/CarRemoteAccessManager.CompletableRemoteTaskFuture)used by the remote task client to notify CarRemoteAccessManager that all pending remote tasks are finalized. <br /> |