public interface

BluetoothManagerPrivileged

masonamerica.platform.BluetoothManagerPrivileged

Class Overview

Privileged Bluetooth operations for Mason applications.

Provides Bluetooth capabilities that require system-level privileges not available to ordinary applications. Obtain an instance via MasonFramework#get(android.content.Context, Class).

Example — connect to a Bluetooth peripheral without prompting the user to confirm pairing:

BluetoothManagerPrivileged bt =
         MasonFramework.get(context, BluetoothManagerPrivileged.class);
 bt.autoConfirmPairing(PairingRequest.justWorks(deviceAddress, 30_000L));
 // ... then initiate the connection/bond as usual
 

Summary

Public Methods
abstract boolean autoConfirmPairing(PairingRequest request)
Automatically confirms the next pairing request for the device described by request, without showing the user the system pairing dialog.

Public Methods

public abstract boolean autoConfirmPairing (PairingRequest request)

Automatically confirms the next pairing request for the device described by request, without showing the user the system pairing dialog.

Call this immediately before initiating a connection or bond to the device. If a pairing request for that device arrives within the request's timeout window, it is confirmed on the application's behalf. The window closes after the first matching request or when the timeout elapses, whichever comes first.

Parameters
request PairingRequest: the target device, the pairing methods that may be auto-confirmed, and the window timeout (see PairingRequest)
Returns
boolean true if the auto-confirmation window was armed