1 /*
2  * Copyright 2008 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.bluetooth;
18 
19 import android.bluetooth.BluetoothCodecConfig;
20 import android.bluetooth.BluetoothCodecStatus;
21 import android.bluetooth.BluetoothCodecType;
22 import android.bluetooth.BluetoothDevice;
23 import android.bluetooth.BufferConstraints;
24 import android.content.AttributionSource;
25 
26 /**
27  * APIs for Bluetooth A2DP service
28  *
29  * @hide
30  */
31 interface IBluetoothA2dp {
32     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
connect(in BluetoothDevice device, in AttributionSource attributionSource)33     boolean connect(in BluetoothDevice device, in AttributionSource attributionSource);
34     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
disconnect(in BluetoothDevice device, in AttributionSource attributionSource)35     boolean disconnect(in BluetoothDevice device, in AttributionSource attributionSource);
36     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
getConnectedDevices(in AttributionSource attributionSource)37     List<BluetoothDevice> getConnectedDevices(in AttributionSource attributionSource);
38     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
getDevicesMatchingConnectionStates(in int[] states, in AttributionSource attributionSource)39     List<BluetoothDevice> getDevicesMatchingConnectionStates(in int[] states, in AttributionSource attributionSource);
40     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
getConnectionState(in BluetoothDevice device, in AttributionSource attributionSource)41     int getConnectionState(in BluetoothDevice device, in AttributionSource attributionSource);
42     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
setActiveDevice(in BluetoothDevice device, in AttributionSource attributionSource)43     boolean setActiveDevice(in BluetoothDevice device, in AttributionSource attributionSource);
44     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
getActiveDevice(in AttributionSource attributionSource)45     BluetoothDevice getActiveDevice(in AttributionSource attributionSource);
46     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
setConnectionPolicy(in BluetoothDevice device, int connectionPolicy, in AttributionSource attributionSource)47     boolean setConnectionPolicy(in BluetoothDevice device, int connectionPolicy, in AttributionSource attributionSource);
48     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
getConnectionPolicy(in BluetoothDevice device, in AttributionSource attributionSource)49     int getConnectionPolicy(in BluetoothDevice device, in AttributionSource attributionSource);
50     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
setAvrcpAbsoluteVolume(int volume, in AttributionSource attributionSource)51     oneway void setAvrcpAbsoluteVolume(int volume, in AttributionSource attributionSource);
52     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
isA2dpPlaying(in BluetoothDevice device, in AttributionSource attributionSource)53     boolean isA2dpPlaying(in BluetoothDevice device, in AttributionSource attributionSource);
54     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED)")
getSupportedCodecTypes(in AttributionSource attributionSource)55     List<BluetoothCodecType> getSupportedCodecTypes(in AttributionSource attributionSource);
56     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
getCodecStatus(in BluetoothDevice device, in AttributionSource attributionSource)57     BluetoothCodecStatus getCodecStatus(in BluetoothDevice device, in AttributionSource attributionSource);
58     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
setCodecConfigPreference(in BluetoothDevice device, in BluetoothCodecConfig codecConfig, in AttributionSource attributionSource)59     oneway void setCodecConfigPreference(in BluetoothDevice device, in BluetoothCodecConfig codecConfig, in AttributionSource attributionSource);
60     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
enableOptionalCodecs(in BluetoothDevice device, in AttributionSource attributionSource)61     oneway void enableOptionalCodecs(in BluetoothDevice device, in AttributionSource attributionSource);
62     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
disableOptionalCodecs(in BluetoothDevice device, in AttributionSource attributionSource)63     oneway void disableOptionalCodecs(in BluetoothDevice device, in AttributionSource attributionSource);
64     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
isOptionalCodecsSupported(in BluetoothDevice device, in AttributionSource attributionSource)65     int isOptionalCodecsSupported(in BluetoothDevice device, in AttributionSource attributionSource);
66     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
isOptionalCodecsEnabled(in BluetoothDevice device, in AttributionSource attributionSource)67     int isOptionalCodecsEnabled(in BluetoothDevice device, in AttributionSource attributionSource);
68     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
setOptionalCodecsEnabled(in BluetoothDevice device, int value, in AttributionSource attributionSource)69     oneway void setOptionalCodecsEnabled(in BluetoothDevice device, int value, in AttributionSource attributionSource);
70     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
getDynamicBufferSupport(in AttributionSource attributionSource)71     int getDynamicBufferSupport(in AttributionSource attributionSource);
72     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
getBufferConstraints(in AttributionSource attributionSource)73     BufferConstraints getBufferConstraints(in AttributionSource attributionSource);
74     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
setBufferLengthMillis(int codec, int size, in AttributionSource attributionSource)75     boolean setBufferLengthMillis(int codec, int size, in AttributionSource attributionSource);
76 }
77