1 /*
2  * Copyright 2014 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.BluetoothDevice;
20 import android.bluetooth.BluetoothHeadsetClientCall;
21 import android.content.AttributionSource;
22 import android.os.Bundle;
23 
24 /**
25  * API for Bluetooth Headset Client service (HFP HF Role)
26  *
27  * {@hide}
28  */
29 interface IBluetoothHeadsetClient {
30     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
connect(in BluetoothDevice device, in AttributionSource attributionSource)31     boolean connect(in BluetoothDevice device, in AttributionSource attributionSource);
32     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
disconnect(in BluetoothDevice device, in AttributionSource attributionSource)33     boolean disconnect(in BluetoothDevice device, in AttributionSource attributionSource);
34 
35     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
getConnectedDevices(in AttributionSource attributionSource)36     List<BluetoothDevice> getConnectedDevices(in AttributionSource attributionSource);
37     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
getDevicesMatchingConnectionStates(in int[] states, in AttributionSource attributionSource)38     List<BluetoothDevice> getDevicesMatchingConnectionStates(in int[] states, in AttributionSource attributionSource);
39     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
getConnectionState(in BluetoothDevice device, in AttributionSource attributionSource)40     int getConnectionState(in BluetoothDevice device, in AttributionSource attributionSource);
41     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
setConnectionPolicy(in BluetoothDevice device, int connectionPolicy, in AttributionSource attributionSource)42     boolean setConnectionPolicy(in BluetoothDevice device, int connectionPolicy, in AttributionSource attributionSource);
43     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
getConnectionPolicy(in BluetoothDevice device, in AttributionSource attributionSource)44     int getConnectionPolicy(in BluetoothDevice device, in AttributionSource attributionSource);
45 
46     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
startVoiceRecognition(in BluetoothDevice device, in AttributionSource attributionSource)47     boolean startVoiceRecognition(in BluetoothDevice device, in AttributionSource attributionSource);
48     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
stopVoiceRecognition(in BluetoothDevice device, in AttributionSource attributionSource)49     boolean stopVoiceRecognition(in BluetoothDevice device, in AttributionSource attributionSource);
50 
51     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
getCurrentCalls(in BluetoothDevice device, in AttributionSource attributionSource)52     List<BluetoothHeadsetClientCall> getCurrentCalls(in BluetoothDevice device, in AttributionSource attributionSource);
53     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
getCurrentAgEvents(in BluetoothDevice device, in AttributionSource attributionSource)54     Bundle getCurrentAgEvents(in BluetoothDevice device, in AttributionSource attributionSource);
55 
56     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
acceptCall(in BluetoothDevice device, int flag, in AttributionSource attributionSource)57     boolean acceptCall(in BluetoothDevice device, int flag, in AttributionSource attributionSource);
58     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
holdCall(in BluetoothDevice device, in AttributionSource attributionSource)59     boolean holdCall(in BluetoothDevice device, in AttributionSource attributionSource);
60     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
rejectCall(in BluetoothDevice device, in AttributionSource attributionSource)61     boolean rejectCall(in BluetoothDevice device, in AttributionSource attributionSource);
62     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
terminateCall(in BluetoothDevice device, in BluetoothHeadsetClientCall call, in AttributionSource attributionSource)63     boolean terminateCall(in BluetoothDevice device, in BluetoothHeadsetClientCall call, in AttributionSource attributionSource);
64 
65     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
enterPrivateMode(in BluetoothDevice device, int index, in AttributionSource attributionSource)66     boolean enterPrivateMode(in BluetoothDevice device, int index, in AttributionSource attributionSource);
67     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
explicitCallTransfer(in BluetoothDevice device, in AttributionSource attributionSource)68     boolean explicitCallTransfer(in BluetoothDevice device, in AttributionSource attributionSource);
69 
70     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
dial(in BluetoothDevice device, String number, in AttributionSource attributionSource)71     BluetoothHeadsetClientCall dial(in BluetoothDevice device, String number, in AttributionSource attributionSource);
72 
73     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
sendDTMF(in BluetoothDevice device, byte code, in AttributionSource attributionSource)74     boolean sendDTMF(in BluetoothDevice device, byte code, in AttributionSource attributionSource);
75     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
getLastVoiceTagNumber(in BluetoothDevice device, in AttributionSource attributionSource)76     boolean getLastVoiceTagNumber(in BluetoothDevice device, in AttributionSource attributionSource);
77 
78     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
getAudioState(in BluetoothDevice device, in AttributionSource attributionSource)79     int getAudioState(in BluetoothDevice device, in AttributionSource attributionSource);
80     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
connectAudio(in BluetoothDevice device, in AttributionSource attributionSource)81     boolean connectAudio(in BluetoothDevice device, in AttributionSource attributionSource);
82     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
disconnectAudio(in BluetoothDevice device, in AttributionSource attributionSource)83     boolean disconnectAudio(in BluetoothDevice device, in AttributionSource attributionSource);
84     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
setAudioRouteAllowed(in BluetoothDevice device, boolean allowed, in AttributionSource attributionSource)85     void setAudioRouteAllowed(in BluetoothDevice device, boolean allowed, in AttributionSource attributionSource);
86     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
getAudioRouteAllowed(in BluetoothDevice device, in AttributionSource attributionSource)87     boolean getAudioRouteAllowed(in BluetoothDevice device, in AttributionSource attributionSource);
88     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
sendVendorAtCommand(in BluetoothDevice device, int vendorId, String atCommand, in AttributionSource attributionSource)89     boolean sendVendorAtCommand(in BluetoothDevice device, int vendorId, String atCommand, in AttributionSource attributionSource);
90 
91     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
getCurrentAgFeatures(in BluetoothDevice device, in AttributionSource attributionSource)92     Bundle getCurrentAgFeatures(in BluetoothDevice device, in AttributionSource attributionSource);
93 }
94