• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 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.IBluetoothCallback;
20 import android.os.ParcelUuid;
21 
22 /**
23  * System private API for talking with the Bluetooth service.
24  *
25  * {@hide}
26  */
27 interface IBluetooth
28 {
isEnabled()29     boolean isEnabled();
getBluetoothState()30     int getBluetoothState();
enable()31     boolean enable();
disable(boolean persistSetting)32     boolean disable(boolean persistSetting);
33 
getAddress()34     String getAddress();
getName()35     String getName();
setName(in String name)36     boolean setName(in String name);
37 
getScanMode()38     int getScanMode();
setScanMode(int mode, int duration)39     boolean setScanMode(int mode, int duration);
40 
getDiscoverableTimeout()41     int getDiscoverableTimeout();
setDiscoverableTimeout(int timeout)42     boolean setDiscoverableTimeout(int timeout);
43 
startDiscovery()44     boolean startDiscovery();
cancelDiscovery()45     boolean cancelDiscovery();
isDiscovering()46     boolean isDiscovering();
readOutOfBandData()47     byte[] readOutOfBandData();
48 
createBond(in String address)49     boolean createBond(in String address);
createBondOutOfBand(in String address, in byte[] hash, in byte[] randomizer)50     boolean createBondOutOfBand(in String address, in byte[] hash, in byte[] randomizer);
cancelBondProcess(in String address)51     boolean cancelBondProcess(in String address);
removeBond(in String address)52     boolean removeBond(in String address);
listBonds()53     String[] listBonds();
getBondState(in String address)54     int getBondState(in String address);
setDeviceOutOfBandData(in String address, in byte[] hash, in byte[] randomizer)55     boolean setDeviceOutOfBandData(in String address, in byte[] hash, in byte[] randomizer);
56 
getRemoteName(in String address)57     String getRemoteName(in String address);
getRemoteClass(in String address)58     int getRemoteClass(in String address);
getRemoteUuids(in String address)59     ParcelUuid[] getRemoteUuids(in String address);
fetchRemoteUuids(in String address, in ParcelUuid uuid, in IBluetoothCallback callback)60     boolean fetchRemoteUuids(in String address, in ParcelUuid uuid, in IBluetoothCallback callback);
getRemoteServiceChannel(in String address, in ParcelUuid uuid)61     int getRemoteServiceChannel(in String address, in ParcelUuid uuid);
62 
setPin(in String address, in byte[] pin)63     boolean setPin(in String address, in byte[] pin);
setPasskey(in String address, int passkey)64     boolean setPasskey(in String address, int passkey);
setPairingConfirmation(in String address, boolean confirm)65     boolean setPairingConfirmation(in String address, boolean confirm);
setRemoteOutOfBandData(in String addres)66     boolean setRemoteOutOfBandData(in String addres);
cancelPairingUserInput(in String address)67     boolean cancelPairingUserInput(in String address);
68 
setTrust(in String address, in boolean value)69     boolean setTrust(in String address, in boolean value);
getTrustState(in String address)70     boolean getTrustState(in String address);
isBluetoothDock(in String address)71     boolean isBluetoothDock(in String address);
72 
addRfcommServiceRecord(in String serviceName, in ParcelUuid uuid, int channel, IBinder b)73     int addRfcommServiceRecord(in String serviceName, in ParcelUuid uuid, int channel, IBinder b);
removeServiceRecord(int handle)74     void removeServiceRecord(int handle);
75 
connectHeadset(String address)76     boolean connectHeadset(String address);
disconnectHeadset(String address)77     boolean disconnectHeadset(String address);
notifyIncomingConnection(String address)78     boolean notifyIncomingConnection(String address);
79 }
80