blob: cf2a343dc0473cfc474d75391b62e41e6ee62ec9 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
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
17package android.bluetooth;
18
Nick Pelly16fb88a2009-10-07 07:44:03 +020019import android.bluetooth.IBluetoothCallback;
Jaikumar Ganeshef2cb7c2011-07-21 18:13:38 -070020import android.bluetooth.IBluetoothStateChangeCallback;
Prerepa Viswanadham8caac742014-07-22 17:00:09 -070021import android.bluetooth.BluetoothActivityEnergyInfo;
Jaikumar Ganesh545e6702010-06-04 10:23:03 -070022import android.bluetooth.BluetoothDevice;
Nick Pellyaef439e2009-09-28 12:33:17 -070023import android.os.ParcelUuid;
Jaikumar Ganesh2ea1e852011-04-01 16:33:09 -070024import android.os.ParcelFileDescriptor;
Jaikumar Ganeshdd0463a2009-09-16 12:30:02 -070025
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080026/**
27 * System private API for talking with the Bluetooth service.
28 *
29 * {@hide}
30 */
Nick Pellybd022f42009-08-14 18:33:38 -070031interface IBluetooth
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080032{
33 boolean isEnabled();
Jaikumar Ganeshe4caddb2012-01-25 16:16:48 -080034 int getState();
The Android Open Source Project10592532009-03-18 17:39:46 -070035 boolean enable();
Matthew Xie96313142012-06-29 16:57:31 -070036 boolean enableNoAutoConnect();
Freda8c6df02012-07-11 10:25:23 -070037 boolean disable();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080038
39 String getAddress();
Jaikumar Ganesh58b93c32010-11-23 20:03:10 -080040 ParcelUuid[] getUuids();
Jaikumar Ganeshe4caddb2012-01-25 16:16:48 -080041 boolean setName(in String name);
42 String getName();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080043
44 int getScanMode();
Nick Pelly12835472009-09-25 15:00:29 -070045 boolean setScanMode(int mode, int duration);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080046
47 int getDiscoverableTimeout();
48 boolean setDiscoverableTimeout(int timeout);
49
Jaikumar Ganeshd5ac1ae2009-05-05 22:26:12 -070050 boolean startDiscovery();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080051 boolean cancelDiscovery();
52 boolean isDiscovering();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080053
Jaikumar Ganeshc53cab22010-10-26 16:02:26 -070054 int getAdapterConnectionState();
Jaikumar Ganeshcb1d3542011-08-19 10:26:32 -070055 int getProfileConnectionState(int profile);
Jaikumar Ganeshc53cab22010-10-26 16:02:26 -070056
Jaikumar Ganeshe4caddb2012-01-25 16:16:48 -080057 BluetoothDevice[] getBondedDevices();
Andre Eisenbach57210c72014-08-04 17:51:43 -070058 boolean createBond(in BluetoothDevice device, in int transport);
Jaikumar Ganeshe4caddb2012-01-25 16:16:48 -080059 boolean cancelBondProcess(in BluetoothDevice device);
60 boolean removeBond(in BluetoothDevice device);
61 int getBondState(in BluetoothDevice device);
Jay Civelli174928c2014-05-08 09:24:08 -070062 boolean isConnected(in BluetoothDevice device);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080063
Jaikumar Ganeshe4caddb2012-01-25 16:16:48 -080064 String getRemoteName(in BluetoothDevice device);
Matthew Xie33ec9842013-04-03 00:29:27 -070065 int getRemoteType(in BluetoothDevice device);
Jaikumar Ganeshe4caddb2012-01-25 16:16:48 -080066 String getRemoteAlias(in BluetoothDevice device);
67 boolean setRemoteAlias(in BluetoothDevice device, in String name);
68 int getRemoteClass(in BluetoothDevice device);
69 ParcelUuid[] getRemoteUuids(in BluetoothDevice device);
fredc4c9caca2012-04-06 02:08:46 -070070 boolean fetchRemoteUuids(in BluetoothDevice device);
Hemant Gupta8949bfb2013-08-16 14:57:55 +053071 boolean fetchRemoteMasInstances(in BluetoothDevice device);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080072
Jaikumar Ganeshe4caddb2012-01-25 16:16:48 -080073 boolean setPin(in BluetoothDevice device, boolean accept, int len, in byte[] pinCode);
74 boolean setPasskey(in BluetoothDevice device, boolean accept, int len, in byte[]
75 passkey);
76 boolean setPairingConfirmation(in BluetoothDevice device, boolean accept);
Jaikumar Ganesh2ea1e852011-04-01 16:33:09 -070077
Edward Jee8dd30aa2014-09-05 00:29:14 -070078 int getPhonebookAccessPermission(in BluetoothDevice device);
79 boolean setPhonebookAccessPermission(in BluetoothDevice device, int value);
80 int getMessageAccessPermission(in BluetoothDevice device);
81 boolean setMessageAccessPermission(in BluetoothDevice device, int value);
82
Jaikumar Ganeshcb1d3542011-08-19 10:26:32 -070083 void sendConnectionStateChange(in BluetoothDevice device, int profile, int state, int prevState);
zzy3b147b72012-04-03 19:48:32 -070084
fredcbf072a72012-05-09 16:52:50 -070085 void registerCallback(in IBluetoothCallback callback);
86 void unregisterCallback(in IBluetoothCallback callback);
87
zzy3b147b72012-04-03 19:48:32 -070088 // For Socket
89 ParcelFileDescriptor connectSocket(in BluetoothDevice device, int type, in ParcelUuid uuid, int port, int flag);
90 ParcelFileDescriptor createSocketChannel(int type, in String serviceName, in ParcelUuid uuid, int port, int flag);
Zhihai Xuaf5971e2013-06-10 20:28:31 -070091
92 boolean configHciSnoopLog(boolean enable);
Prerepa Viswanadham0c116e12014-07-02 12:30:38 -070093
94 boolean isMultiAdvertisementSupported();
95 boolean isOffloadedFilteringSupported();
96 boolean isOffloadedScanBatchingSupported();
Prerepa Viswanadham8caac742014-07-22 17:00:09 -070097 boolean isActivityAndEnergyReportingSupported();
98 void getActivityEnergyInfoFromController();
99 BluetoothActivityEnergyInfo reportActivityInfo();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800100}