/**@class android.companion.CompanionDeviceManager @extends java.lang.Object System level service for managing companion devices <p>To obtain an instance call {@link Context#getSystemService}({@link Context#COMPANION_DEVICE_SERVICE}) Then, call {@link #associate(AssociationRequest, android.companion.CompanionDeviceManager.Callback, Handler)} to initiate the flow of associating current package with a device selected by user.</p> @see AssociationRequest */ var CompanionDeviceManager = { /** A device, returned in the activity result of the {@link IntentSender} received in {@link android.companion.CompanionDeviceManager.Callback#onDeviceFound} */ EXTRA_DEVICE : "android.companion.extra.DEVICE", /** The package name of the companion device discovery component. @hide */ COMPANION_DEVICE_DISCOVERY_PACKAGE_NAME : "com.android.companiondevicemanager", /**Associate this app with a companion device, selected by user <p>Once at least one appropriate device is found, {@code callback} will be called with a {@link PendingIntent} that can be used to show the list of available devices for the user to select. It should be started for result (i.e. using {@link android.app.Activity#startIntentSenderForResult}), as the resulting {@link android.content.Intent} will contain extra {@link #EXTRA_DEVICE}, with the selected device. (e.g. {@link android.bluetooth.BluetoothDevice})</p> <p>If your app needs to be excluded from battery optimizations (run in the background) or to have unrestricted data access (use data in the background) you can declare that you use the {@link android.Manifest.permission#REQUEST_COMPANION_RUN_IN_BACKGROUND} and {@link android.Manifest.permission#REQUEST_COMPANION_USE_DATA_IN_BACKGROUND} respectively. Note that these special capabilities have a negative effect on the device's battery and user's data usage, therefore you should requested them when absolutely necessary.</p> <p>You can call {@link #getAssociations} to get the list of currently associated devices, and {@link #disassociate} to remove an association. Consider doing so when the association is no longer relevant to avoid unnecessary battery and/or data drain resulting from special privileges that the association provides</p> <p>Calling this API requires a uses-feature {@link PackageManager#FEATURE_COMPANION_DEVICE_SETUP} declaration in the manifest</p> @param {Object {AssociationRequest}} request specific details about this request @param {Object {CompanionDeviceManager.Callback}} callback will be called once there's at least one device found for user to choose from @param {Object {Handler}} handler A handler to control which thread the callback will be delivered on, or null, to deliver it on main thread @see AssociationRequest */ associate : function( ) {}, /**<p>Calling this API requires a uses-feature {@link PackageManager#FEATURE_COMPANION_DEVICE_SETUP} declaration in the manifest</p> @return {Object {java.util.List}} a list of MAC addresses of devices that have been previously associated with the current app. You can use these with {@link #disassociate} */ getAssociations : function( ) {}, /**Remove the association between this app and the device with the given mac address. <p>Any privileges provided via being associated with a given device will be revoked</p> <p>Consider doing so when the association is no longer relevant to avoid unnecessary battery and/or data drain resulting from special privileges that the association provides</p> <p>Calling this API requires a uses-feature {@link PackageManager#FEATURE_COMPANION_DEVICE_SETUP} declaration in the manifest</p> @param {String} deviceMacAddress the MAC address of device to disassociate from this app */ disassociate : function( ) {}, /**Request notification access for the given component. The given component must follow the protocol specified in {@link NotificationListenerService} Only components from the same {@link ComponentName#getPackageName package} as the calling app are allowed. Your app must have an association with a device before calling this API <p>Calling this API requires a uses-feature {@link PackageManager#FEATURE_COMPANION_DEVICE_SETUP} declaration in the manifest</p> */ requestNotificationAccess : function( ) {}, /**Check whether the given component can access the notifications via a {@link NotificationListenerService} Your app must have an association with a device before calling this API <p>Calling this API requires a uses-feature {@link PackageManager#FEATURE_COMPANION_DEVICE_SETUP} declaration in the manifest</p> @param {Object {ComponentName}} component the name of the component @return {Boolean} whether the given component has the notification listener permission */ hasNotificationAccess : function( ) {}, };