BridgingManager

public final class BridgingManager


APIs to enable/disable notification bridging at runtime.

Using a BridgingManager object, you can set a bridging mode, and optionally set tags for notifications that are exempt from the bridging mode. Specifically, create a BridgingConfig object and set is as shown in the example usages below:

  • Disable bridging at runtime:

BridgingManager.fromContext(context).setConfig(
new BridgingConfig.Builder(context, false).build()
);
  • Disable bridging at runtime except for the tags "foo" and "bar":

BridgingManager.fromContext(context).setConfig(
new BridgingConfig.Builder(context, false)
.addExcludedTag("foo")
.addExcludedTag("bar")
.build()
);
  • Disable bridging at runtime except for the tags "foo" and "bar" and "baz":

BridgingManager.fromContext(context).setConfig(
new BridgingConfig.Builder(context, false)
.addExcludedTags(Arrays.asList("foo", "bar", "baz"))
.build()
);
  • Adding a bridge tag to a notification posted on a phone:

NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context)
// ... set other fields ...
.extend(
new NotificationCompat.WearableExtender()
.setBridgeTag("foo")
);
Notification notification = notificationBuilder.build();

See also:

Summary

Public methods

final void
setConfig(BridgingConfig bridgingConfig)

Sets the BridgingConfig object.

Public methods

setConfig

public final void setConfig(BridgingConfig bridgingConfig)

Sets the BridgingConfig object.

Parameters
BridgingConfig bridgingConfig

The BridgingConfig object.

Throws
kotlin.RuntimeException

if the service binding is failed.