@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH)

Here are the examples of the java api @android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

17 Source : BluetoothHeadset.java
with Apache License 2.0
from lulululbj

/**
 * Check if in-band ringing is currently enabled. In-band ringing could be disabled during an
 * active connection.
 *
 * @return true if in-band ringing is enabled, false if in-band ringing is disabled
 * @hide
 */
@RequiresPermission(android.Manifest.permission.BLUETOOTH)
public boolean isInbandRingingEnabled() {
    if (DBG) {
        log("isInbandRingingEnabled()");
    }
    final IBluetoothHeadset service = mService;
    if (service != null && isEnabled()) {
        try {
            return service.isInbandRingingEnabled();
        } catch (RemoteException e) {
            Log.e(TAG, Log.getStackTraceString(new Throwable()));
        }
    }
    if (service == null) {
        Log.w(TAG, "Proxy not attached to service");
    }
    return false;
}

16 Source : BluetoothHeadset.java
with Apache License 2.0
from lulululbj

/**
 * Get the connected device that is active.
 *
 * <p>Requires {@link android.Manifest.permission#BLUETOOTH}
 * permission.
 *
 * @return the connected device that is active or null if no device
 * is active.
 * @hide
 */
@RequiresPermission(android.Manifest.permission.BLUETOOTH)
public BluetoothDevice getActiveDevice() {
    if (VDBG) {
        Log.d(TAG, "getActiveDevice");
    }
    final IBluetoothHeadset service = mService;
    if (service != null && isEnabled()) {
        try {
            return service.getActiveDevice();
        } catch (RemoteException e) {
            Log.e(TAG, Log.getStackTraceString(new Throwable()));
        }
    }
    if (service == null) {
        Log.w(TAG, "Proxy not attached to service");
    }
    return null;
}