The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 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 | |
Nick Pelly | 16fb88a | 2009-10-07 07:44:03 +0200 | [diff] [blame] | 19 | import android.bluetooth.IBluetoothCallback; |
Jaikumar Ganesh | ef2cb7c | 2011-07-21 18:13:38 -0700 | [diff] [blame] | 20 | import android.bluetooth.IBluetoothStateChangeCallback; |
Prerepa Viswanadham | 8caac74 | 2014-07-22 17:00:09 -0700 | [diff] [blame] | 21 | import android.bluetooth.BluetoothActivityEnergyInfo; |
Jaikumar Ganesh | 545e670 | 2010-06-04 10:23:03 -0700 | [diff] [blame] | 22 | import android.bluetooth.BluetoothDevice; |
Nick Pelly | aef439e | 2009-09-28 12:33:17 -0700 | [diff] [blame] | 23 | import android.os.ParcelUuid; |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 24 | import android.os.ParcelFileDescriptor; |
Jaikumar Ganesh | dd0463a | 2009-09-16 12:30:02 -0700 | [diff] [blame] | 25 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 26 | /** |
| 27 | * System private API for talking with the Bluetooth service. |
| 28 | * |
| 29 | * {@hide} |
| 30 | */ |
Nick Pelly | bd022f4 | 2009-08-14 18:33:38 -0700 | [diff] [blame] | 31 | interface IBluetooth |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 32 | { |
| 33 | boolean isEnabled(); |
Jaikumar Ganesh | e4caddb | 2012-01-25 16:16:48 -0800 | [diff] [blame] | 34 | int getState(); |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 35 | boolean enable(); |
Matthew Xie | 9631314 | 2012-06-29 16:57:31 -0700 | [diff] [blame] | 36 | boolean enableNoAutoConnect(); |
Fred | a8c6df0 | 2012-07-11 10:25:23 -0700 | [diff] [blame] | 37 | boolean disable(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 38 | |
| 39 | String getAddress(); |
Jaikumar Ganesh | 58b93c3 | 2010-11-23 20:03:10 -0800 | [diff] [blame] | 40 | ParcelUuid[] getUuids(); |
Jaikumar Ganesh | e4caddb | 2012-01-25 16:16:48 -0800 | [diff] [blame] | 41 | boolean setName(in String name); |
| 42 | String getName(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 43 | |
| 44 | int getScanMode(); |
Nick Pelly | 1283547 | 2009-09-25 15:00:29 -0700 | [diff] [blame] | 45 | boolean setScanMode(int mode, int duration); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 46 | |
| 47 | int getDiscoverableTimeout(); |
| 48 | boolean setDiscoverableTimeout(int timeout); |
| 49 | |
Jaikumar Ganesh | d5ac1ae | 2009-05-05 22:26:12 -0700 | [diff] [blame] | 50 | boolean startDiscovery(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 51 | boolean cancelDiscovery(); |
| 52 | boolean isDiscovering(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 53 | |
Jaikumar Ganesh | c53cab2 | 2010-10-26 16:02:26 -0700 | [diff] [blame] | 54 | int getAdapterConnectionState(); |
Jaikumar Ganesh | cb1d354 | 2011-08-19 10:26:32 -0700 | [diff] [blame] | 55 | int getProfileConnectionState(int profile); |
Jaikumar Ganesh | c53cab2 | 2010-10-26 16:02:26 -0700 | [diff] [blame] | 56 | |
Jaikumar Ganesh | e4caddb | 2012-01-25 16:16:48 -0800 | [diff] [blame] | 57 | BluetoothDevice[] getBondedDevices(); |
Andre Eisenbach | 57210c7 | 2014-08-04 17:51:43 -0700 | [diff] [blame] | 58 | boolean createBond(in BluetoothDevice device, in int transport); |
Jaikumar Ganesh | e4caddb | 2012-01-25 16:16:48 -0800 | [diff] [blame] | 59 | boolean cancelBondProcess(in BluetoothDevice device); |
| 60 | boolean removeBond(in BluetoothDevice device); |
| 61 | int getBondState(in BluetoothDevice device); |
Jay Civelli | 174928c | 2014-05-08 09:24:08 -0700 | [diff] [blame] | 62 | boolean isConnected(in BluetoothDevice device); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 63 | |
Jaikumar Ganesh | e4caddb | 2012-01-25 16:16:48 -0800 | [diff] [blame] | 64 | String getRemoteName(in BluetoothDevice device); |
Matthew Xie | 33ec984 | 2013-04-03 00:29:27 -0700 | [diff] [blame] | 65 | int getRemoteType(in BluetoothDevice device); |
Jaikumar Ganesh | e4caddb | 2012-01-25 16:16:48 -0800 | [diff] [blame] | 66 | 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); |
fredc | 4c9caca | 2012-04-06 02:08:46 -0700 | [diff] [blame] | 70 | boolean fetchRemoteUuids(in BluetoothDevice device); |
Hemant Gupta | 8949bfb | 2013-08-16 14:57:55 +0530 | [diff] [blame] | 71 | boolean fetchRemoteMasInstances(in BluetoothDevice device); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 72 | |
Jaikumar Ganesh | e4caddb | 2012-01-25 16:16:48 -0800 | [diff] [blame] | 73 | 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 Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 77 | |
Edward Jee | 8dd30aa | 2014-09-05 00:29:14 -0700 | [diff] [blame] | 78 | 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 Ganesh | cb1d354 | 2011-08-19 10:26:32 -0700 | [diff] [blame] | 83 | void sendConnectionStateChange(in BluetoothDevice device, int profile, int state, int prevState); |
zzy | 3b147b7 | 2012-04-03 19:48:32 -0700 | [diff] [blame] | 84 | |
fredc | bf072a7 | 2012-05-09 16:52:50 -0700 | [diff] [blame] | 85 | void registerCallback(in IBluetoothCallback callback); |
| 86 | void unregisterCallback(in IBluetoothCallback callback); |
| 87 | |
zzy | 3b147b7 | 2012-04-03 19:48:32 -0700 | [diff] [blame] | 88 | // 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 Xu | af5971e | 2013-06-10 20:28:31 -0700 | [diff] [blame] | 91 | |
| 92 | boolean configHciSnoopLog(boolean enable); |
Prerepa Viswanadham | 0c116e1 | 2014-07-02 12:30:38 -0700 | [diff] [blame] | 93 | |
| 94 | boolean isMultiAdvertisementSupported(); |
| 95 | boolean isOffloadedFilteringSupported(); |
| 96 | boolean isOffloadedScanBatchingSupported(); |
Prerepa Viswanadham | 8caac74 | 2014-07-22 17:00:09 -0700 | [diff] [blame] | 97 | boolean isActivityAndEnergyReportingSupported(); |
| 98 | void getActivityEnergyInfoFromController(); |
| 99 | BluetoothActivityEnergyInfo reportActivityInfo(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 100 | } |