BridgingManager


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 companion functions

BridgingManager
fromContext(context: Context)

Create a BridgingManager instance with the passed in Context.

Public functions

Unit
setConfig(bridgingConfig: BridgingConfig)

Sets the BridgingConfig object.

Public companion functions

fromContext

Added in 1.0.0
fun fromContext(context: Context): BridgingManager

Create a BridgingManager instance with the passed in Context.

Parameters
context: Context

Context object.

Public functions

setConfig

Added in 1.0.0
fun setConfig(bridgingConfig: BridgingConfig): Unit

Sets the BridgingConfig object.

Parameters
bridgingConfig: BridgingConfig

The BridgingConfig object.

Throws
kotlin.RuntimeException

if the service binding is failed.