• 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.bluetooth.IBluetoothStateChangeCallback;
21 import android.bluetooth.BluetoothActivityEnergyInfo;
22 import android.bluetooth.BluetoothDevice;
23 import android.os.ParcelUuid;
24 import android.os.ParcelFileDescriptor;
25 
26 /**
27  * System private API for talking with the Bluetooth service.
28  *
29  * {@hide}
30  */
31 interface IBluetooth
32 {
isEnabled()33     boolean isEnabled();
getState()34     int getState();
enable()35     boolean enable();
enableNoAutoConnect()36     boolean enableNoAutoConnect();
disable()37     boolean disable();
38 
getAddress()39     String getAddress();
getUuids()40     ParcelUuid[] getUuids();
setName(in String name)41     boolean setName(in String name);
getName()42     String getName();
43 
getScanMode()44     int getScanMode();
setScanMode(int mode, int duration)45     boolean setScanMode(int mode, int duration);
46 
getDiscoverableTimeout()47     int getDiscoverableTimeout();
setDiscoverableTimeout(int timeout)48     boolean setDiscoverableTimeout(int timeout);
49 
startDiscovery()50     boolean startDiscovery();
cancelDiscovery()51     boolean cancelDiscovery();
isDiscovering()52     boolean isDiscovering();
53 
getAdapterConnectionState()54     int getAdapterConnectionState();
getProfileConnectionState(int profile)55     int getProfileConnectionState(int profile);
56 
getBondedDevices()57     BluetoothDevice[] getBondedDevices();
createBond(in BluetoothDevice device, in int transport)58     boolean createBond(in BluetoothDevice device, in int transport);
cancelBondProcess(in BluetoothDevice device)59     boolean cancelBondProcess(in BluetoothDevice device);
removeBond(in BluetoothDevice device)60     boolean removeBond(in BluetoothDevice device);
getBondState(in BluetoothDevice device)61     int getBondState(in BluetoothDevice device);
isConnected(in BluetoothDevice device)62     boolean isConnected(in BluetoothDevice device);
63 
getRemoteName(in BluetoothDevice device)64     String getRemoteName(in BluetoothDevice device);
getRemoteType(in BluetoothDevice device)65     int getRemoteType(in BluetoothDevice device);
getRemoteAlias(in BluetoothDevice device)66     String getRemoteAlias(in BluetoothDevice device);
setRemoteAlias(in BluetoothDevice device, in String name)67     boolean setRemoteAlias(in BluetoothDevice device, in String name);
getRemoteClass(in BluetoothDevice device)68     int getRemoteClass(in BluetoothDevice device);
getRemoteUuids(in BluetoothDevice device)69     ParcelUuid[] getRemoteUuids(in BluetoothDevice device);
fetchRemoteUuids(in BluetoothDevice device)70     boolean fetchRemoteUuids(in BluetoothDevice device);
fetchRemoteMasInstances(in BluetoothDevice device)71     boolean fetchRemoteMasInstances(in BluetoothDevice device);
72 
setPin(in BluetoothDevice device, boolean accept, int len, in byte[] pinCode)73     boolean setPin(in BluetoothDevice device, boolean accept, int len, in byte[] pinCode);
setPasskey(in BluetoothDevice device, boolean accept, int len, in byte[] passkey)74     boolean setPasskey(in BluetoothDevice device, boolean accept, int len, in byte[]
75     passkey);
setPairingConfirmation(in BluetoothDevice device, boolean accept)76     boolean setPairingConfirmation(in BluetoothDevice device, boolean accept);
77 
getPhonebookAccessPermission(in BluetoothDevice device)78     int getPhonebookAccessPermission(in BluetoothDevice device);
setPhonebookAccessPermission(in BluetoothDevice device, int value)79     boolean setPhonebookAccessPermission(in BluetoothDevice device, int value);
getMessageAccessPermission(in BluetoothDevice device)80     int getMessageAccessPermission(in BluetoothDevice device);
setMessageAccessPermission(in BluetoothDevice device, int value)81     boolean setMessageAccessPermission(in BluetoothDevice device, int value);
82 
sendConnectionStateChange(in BluetoothDevice device, int profile, int state, int prevState)83     void sendConnectionStateChange(in BluetoothDevice device, int profile, int state, int prevState);
84 
registerCallback(in IBluetoothCallback callback)85     void registerCallback(in IBluetoothCallback callback);
unregisterCallback(in IBluetoothCallback callback)86     void unregisterCallback(in IBluetoothCallback callback);
87 
88     // For Socket
connectSocket(in BluetoothDevice device, int type, in ParcelUuid uuid, int port, int flag)89     ParcelFileDescriptor connectSocket(in BluetoothDevice device, int type, in ParcelUuid uuid, int port, int flag);
createSocketChannel(int type, in String serviceName, in ParcelUuid uuid, int port, int flag)90     ParcelFileDescriptor createSocketChannel(int type, in String serviceName, in ParcelUuid uuid, int port, int flag);
91 
configHciSnoopLog(boolean enable)92     boolean configHciSnoopLog(boolean enable);
93 
isMultiAdvertisementSupported()94     boolean isMultiAdvertisementSupported();
isOffloadedFilteringSupported()95     boolean isOffloadedFilteringSupported();
isOffloadedScanBatchingSupported()96     boolean isOffloadedScanBatchingSupported();
isActivityAndEnergyReportingSupported()97     boolean isActivityAndEnergyReportingSupported();
getActivityEnergyInfoFromController()98     void getActivityEnergyInfoFromController();
reportActivityInfo()99     BluetoothActivityEnergyInfo reportActivityInfo();
100 }
101