Added in [version 33.3](https://developer.android.com/topic/libraries/support-library/revisions) Summary: [Constants](https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#constants) \| [Methods](https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#inhmethods)

# RemoteInteractionsManager


`
public

final

class
RemoteInteractionsManager
`


`

extends Object


`

`


`

|---|---|
| java.lang.Object ||
| ↳ | com.google.wear.services.remoteinteractions.RemoteInteractionsManager |

<br />

*** ** * ** ***

The API for managing remote interactions.

Remote Interactions are operations issued by the watch to a companion device, such as paired
phone. They are not available when there is no paired device present.

An instance of this class can be obtained directly via the Wear OS SDK by invoking the following
API:

`com.google.wear.Sdk.getWearManager(context, RemoteInteractionsManager.class);`

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_AVAILABLE` Indicates that remote interaction is available. |
| `int` | `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_TEMPORARILY_UNAVAILABLE` Indicates that remote interaction is temporarily unavailable. |
| `int` | `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_UNAVAILABLE` Indicates that remote interaction is unavailable. |
| `int` | `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_UNKNOWN` The remote interaction's availability is unknown. |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#continueActivityOnPhoneWithUnlock(java.lang.String,%20java.lang.String,%20android.net.Uri,%20java.util.List<java.lang.String>,%20java.lang.String,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver<java.lang.Void,java.lang.Throwable>)(String targetPackage, String targetAction, Uri targetUri, List<String> targetCategories, String callerPackage, Executor executor, OutcomeReceiver<Void, Throwable> outcomeReceiver) ` Start a Remote Activity on the connected companion phone after unlocking the phone. |
| ` void` | ` https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#registerContinueActivityOnPhoneWithUnlockStatusListener(java.util.concurrent.Executor,%20java.util.function.Consumer<java.lang.Integer>)(Executor listenerExecutor, Consumer<Integer> listener) ` Registers a listener for ContinueActivityOnPhoneWithUnlock's availability status changes. |
| ` void` | ` https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#registerRemoteActivityHelperStatusListener(java.util.concurrent.Executor,%20java.util.function.Consumer<java.lang.Integer>)(Executor listenerExecutor, Consumer<Integer> listener) ` Registers a listener for RemoteActivityHelper's availability status change. |
| ` void` | ` https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#registerRemoteAuthClientStatusListener(java.util.concurrent.Executor,%20java.util.function.Consumer<java.lang.Integer>)(Executor listenerExecutor, Consumer<Integer> listener) ` Registers a listener for RemoteAuthClient's availability status change. |
| ` void` | ` https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#startRemoteActivity(android.net.Uri,%20java.util.List<java.lang.String>,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver<java.lang.Void,java.lang.Throwable>)(Uri dataUri, List<String> additionalCategories, Executor executor, OutcomeReceiver<Void, Throwable> outcomeReceiver) ` Starts a Remote Activity on the connected Companion device where the intent action will be set to `https://developer.android.com/reference/android/content/Intent#ACTION_VIEW`. |
| ` void` | ` https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#unregisterContinueActivityOnPhoneWithUnlockStatusListener(java.util.function.Consumer<java.lang.Integer>)(Consumer<Integer> listener) ` Unregisters a listener for ContinueActivityOnPhoneWithUnlock's availability status changes. |
| ` void` | ` https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#unregisterRemoteActivityHelperStatusListener(java.util.function.Consumer<java.lang.Integer>)(Consumer<Integer> listener) ` Unregisters a listener for RemoteActivityHelper's availability status change. |
| ` void` | ` https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#unregisterRemoteAuthClientStatusListener(java.util.function.Consumer<java.lang.Integer>)(Consumer<Integer> listener) ` Unregisters a listener for RemoteAuthClient's availability status change. |

| ### Inherited methods |
|---|---|
| From class ` java.lang.Object ` |---|---| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class<?>` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` String` | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||

## Constants

### STATUS_AVAILABLE

Added in [version 33.3](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final int STATUS_AVAILABLE
```

Indicates that remote interaction is available.

This indicates that there is a connected device capable to handle the remote interaction.

<br />

Constant Value:

3
(0x00000003)


### STATUS_TEMPORARILY_UNAVAILABLE

Added in [version 33.3](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final int STATUS_TEMPORARILY_UNAVAILABLE
```

Indicates that remote interaction is temporarily unavailable.

This indicates that there is a known device capable of handling remote interactions, but
that it is not currently connected.

<br />

Constant Value:

2
(0x00000002)


### STATUS_UNAVAILABLE

Added in [version 33.3](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final int STATUS_UNAVAILABLE
```

Indicates that remote interaction is unavailable.

This indicates that there is no paired device capable to handle the remote interaction.

<br />

Constant Value:

1
(0x00000001)


### STATUS_UNKNOWN

Added in [version 33.3](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final int STATUS_UNKNOWN
```

The remote interaction's availability is unknown.

<br />

Constant Value:

0
(0x00000000)


## Public methods

### continueActivityOnPhoneWithUnlock

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void continueActivityOnPhoneWithUnlock (String targetPackage, 
                String targetAction, 
                Uri targetUri, 
                List<String> targetCategories, 
                String callerPackage, 
                Executor executor, 
                OutcomeReceiver<Void, Throwable> outcomeReceiver)
```

Start a Remote Activity on the connected companion phone after unlocking the phone.

This API determines if the request qualifies to unlock the phone and start an activity on
it. Qualification is that the caller should be in the foreground, have permission granted.
Target intent should be within the same package on the phone, or the target intent is an
`https://developer.android.com/reference/android/content/Intent#ACTION_VIEW` `https://developer.android.com/reference/android/content/Intent` with category `https://developer.android.com/reference/android/content/Intent#CATEGORY_BROWSABLE` with an empty `https://developer.android.com/reference/android/content/Intent` and the `https://developer.android.com/reference/android/content/Intent` starting with "https". If the request qualifies, it sends the request to
Companion. Otherwise, the request will be rejected and the result will be returned via `https://developer.android.com/reference/android/os/OutcomeReceiver`. If unlock is not successful, the request will fail and the result will be
returned via `https://developer.android.com/reference/android/os/OutcomeReceiver` as well.

Based on the parameters provided, the intent that will be sent to the phone will be
constructed as follows:

```
 Intent remoteIntent = new Intent()
                       .setPackage(targetPackage)
                       .setAction(targetAction)
                       .setData(targetUri);
 for (String category : targetCategories) {
     remoteIntent.addCategory(category);
 }
 
```
.   
Requires com.google.wear.services.Permissions.SEND_CONTINUE_ACTIVITY_ON_PHONE

<br />

<br />

| Parameters ||
|---|---|
| `targetPackage` | `String`: The package name of the intent to open on the remote device. <br /> |
| `targetAction` | `String`: The action of the intent to open on the remote device. <br /> |
| `targetUri` | `Uri`: The data Uri of the intent to open on the remote device. <br /> |
| `targetCategories` | `List`: The categories of the intent to open on the remote device. <br /> |
| `callerPackage` | `String`: Caller specifies their package name. Needed to address cases of shared UID. <br /> |
| `executor` | `Executor`: The executor to use for the callback <br /> |
| `outcomeReceiver` | `OutcomeReceiver`: An `https://developer.android.com/reference/android/os/OutcomeReceiver` to pass the operation result back to the caller as described above. <br /> |

### registerContinueActivityOnPhoneWithUnlockStatusListener

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void registerContinueActivityOnPhoneWithUnlockStatusListener (Executor listenerExecutor, 
                Consumer<Integer> listener)
```

Registers a listener for ContinueActivityOnPhoneWithUnlock's availability status changes.
ContinueActivityOnPhoneWithUnlock can then be used to unlock the phone and launch an activity
on the paired phone.

Initial availability status will be delivered upon registration once known.


Requires com.google.wear.services.Permissions.SEND_CONTINUE_ACTIVITY_ON_PHONE

<br />

| Parameters ||
|---|---|
| `listenerExecutor` | `Executor`: The executor that the listener runs on. This value cannot be `null`. Listener events are dispatched through this Executor, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. <br /> |
| `listener` | `Consumer`: A listener that will consume the availability status change, see `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager`. Value is one of the following: - `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_UNKNOWN` - `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_UNAVAILABLE` - `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_TEMPORARILY_UNAVAILABLE` - `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_AVAILABLE` |

### registerRemoteActivityHelperStatusListener

Added in [version 33.3](https://developer.android.com/topic/libraries/support-library/revisions)

```
public void registerRemoteActivityHelperStatusListener (Executor listenerExecutor, 
                Consumer<Integer> listener)
```

Registers a listener for RemoteActivityHelper's availability status change.
RemoteActivityHelper can be used to open a screen on the phone.

Initial availability status will be delivered upon registration once known.

<br />

| Parameters ||
|---|---|
| `listenerExecutor` | `Executor`: The executor that the listener runs on. This value cannot be `null`. Listener events are dispatched through this Executor, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. <br /> |
| `listener` | `Consumer`: A listener that will consume the availability status change, see `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager`. Value is one of the following: - `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_UNKNOWN` - `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_UNAVAILABLE` - `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_TEMPORARILY_UNAVAILABLE` - `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_AVAILABLE` |

### registerRemoteAuthClientStatusListener

Added in [version 33.3](https://developer.android.com/topic/libraries/support-library/revisions)

```
public void registerRemoteAuthClientStatusListener (Executor listenerExecutor, 
                Consumer<Integer> listener)
```

Registers a listener for RemoteAuthClient's availability status change. RemoteAuthClient can
be used to initiate remote authentication on the phone.

Initial availability status will be delivered upon registration once known.

<br />

| Parameters ||
|---|---|
| `listenerExecutor` | `Executor`: The executor that the listener runs on. This value cannot be `null`. Listener events are dispatched through this Executor, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. <br /> |
| `listener` | `Consumer`: A listener that will consume the availability status change, see `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager`. Value is one of the following: - `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_UNKNOWN` - `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_UNAVAILABLE` - `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_TEMPORARILY_UNAVAILABLE` - `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_AVAILABLE` |

### startRemoteActivity

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void startRemoteActivity (Uri dataUri, 
                List<String> additionalCategories, 
                Executor executor, 
                OutcomeReceiver<Void, Throwable> outcomeReceiver)
```

Starts a Remote Activity on the connected Companion device where the intent action will be
set to `https://developer.android.com/reference/android/content/Intent#ACTION_VIEW`.

This API must be called from the foreground. Otherwise, the request will be rejected and
an error will be returned via the `https://developer.android.com/reference/android/os/OutcomeReceiver`.

How the intent will be constructed:

```
 Intent remoteIntent = new Intent(Intent.ACTION_VIEW)
                      .setData(dataUri)
                      .addCategory(Intent.CATEGORY_BROWSABLE);

 if (additionalCategories != null) {
      for (String category : additionalCategories) {
          remoteIntent.addCategory(category);
      }
 }
 
```

<br />

<br />

| Parameters ||
|---|---|
| `dataUri` | `Uri`: for the intent to open on the remote device, this data uri will be populated using `https://developer.android.com/reference/android/content/Intent`. <br /> |
| `additionalCategories` | `List`: the categories to use, the category `https://developer.android.com/reference/android/content/Intent#CATEGORY_BROWSABLE` will be added to the list of categories. <br /> |
| `executor` | `Executor`: the executor which will be used to make the call and process the result. <br /> |
| `outcomeReceiver` | `OutcomeReceiver`: an `https://developer.android.com/reference/android/os/OutcomeReceiver` that will receive a void result when the activity was started successfully. <br /> |

### unregisterContinueActivityOnPhoneWithUnlockStatusListener

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void unregisterContinueActivityOnPhoneWithUnlockStatusListener (Consumer<Integer> listener)
```

Unregisters a listener for ContinueActivityOnPhoneWithUnlock's availability status changes.


Requires com.google.wear.services.Permissions.SEND_CONTINUE_ACTIVITY_ON_PHONE

<br />

| Parameters ||
|---|---|
| `listener` | `Consumer`: A previously registered listener from `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager`. Value is one of the following: - `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_UNKNOWN` - `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_UNAVAILABLE` - `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_TEMPORARILY_UNAVAILABLE` - `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_AVAILABLE` |

| Throws ||
|---|---|
| `IllegalArgumentException` | if the listener is not registered. |

### unregisterRemoteActivityHelperStatusListener

Added in [version 33.3](https://developer.android.com/topic/libraries/support-library/revisions)

```
public void unregisterRemoteActivityHelperStatusListener (Consumer<Integer> listener)
```

Unregisters a listener for RemoteActivityHelper's availability status change.

<br />

| Parameters ||
|---|---|
| `listener` | `Consumer`: A previously registered listener from `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager`. Value is one of the following: - `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_UNKNOWN` - `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_UNAVAILABLE` - `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_TEMPORARILY_UNAVAILABLE` - `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_AVAILABLE` |

| Throws ||
|---|---|
| `IllegalArgumentException` | if the listener is not registered. |

### unregisterRemoteAuthClientStatusListener

Added in [version 33.3](https://developer.android.com/topic/libraries/support-library/revisions)

```
public void unregisterRemoteAuthClientStatusListener (Consumer<Integer> listener)
```

Unregisters a listener for RemoteAuthClient's availability status change.

<br />

| Parameters ||
|---|---|
| `listener` | `Consumer`: A previously registered listener from `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager`. Value is one of the following: - `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_UNKNOWN` - `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_UNAVAILABLE` - `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_TEMPORARILY_UNAVAILABLE` - `https://developer.android.com/reference/com/google/wear/services/remoteinteractions/RemoteInteractionsManager#STATUS_AVAILABLE` |

| Throws ||
|---|---|
| `IllegalArgumentException` | if the listener is not registered. |