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; |
Jaikumar Ganesh | 545e670 | 2010-06-04 10:23:03 -0700 | [diff] [blame] | 21 | import android.bluetooth.BluetoothDevice; |
Nick Pelly | aef439e | 2009-09-28 12:33:17 -0700 | [diff] [blame] | 22 | import android.os.ParcelUuid; |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 23 | import android.os.ParcelFileDescriptor; |
Jaikumar Ganesh | dd0463a | 2009-09-16 12:30:02 -0700 | [diff] [blame] | 24 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 25 | /** |
| 26 | * System private API for talking with the Bluetooth service. |
| 27 | * |
| 28 | * {@hide} |
| 29 | */ |
Nick Pelly | bd022f4 | 2009-08-14 18:33:38 -0700 | [diff] [blame] | 30 | interface IBluetooth |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 31 | { |
| 32 | boolean isEnabled(); |
Jaikumar Ganesh | e4caddb | 2012-01-25 16:16:48 -0800 | [diff] [blame] | 33 | int getState(); |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 34 | boolean enable(); |
Matthew Xie | 9631314 | 2012-06-29 16:57:31 -0700 | [diff] [blame] | 35 | boolean enableNoAutoConnect(); |
Fred | a8c6df0 | 2012-07-11 10:25:23 -0700 | [diff] [blame] | 36 | boolean disable(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 37 | |
| 38 | String getAddress(); |
Jaikumar Ganesh | 58b93c3 | 2010-11-23 20:03:10 -0800 | [diff] [blame] | 39 | ParcelUuid[] getUuids(); |
Jaikumar Ganesh | e4caddb | 2012-01-25 16:16:48 -0800 | [diff] [blame] | 40 | boolean setName(in String name); |
| 41 | String getName(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 42 | |
| 43 | int getScanMode(); |
Nick Pelly | 1283547 | 2009-09-25 15:00:29 -0700 | [diff] [blame] | 44 | boolean setScanMode(int mode, int duration); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 45 | |
| 46 | int getDiscoverableTimeout(); |
| 47 | boolean setDiscoverableTimeout(int timeout); |
| 48 | |
Jaikumar Ganesh | d5ac1ae | 2009-05-05 22:26:12 -0700 | [diff] [blame] | 49 | boolean startDiscovery(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 50 | boolean cancelDiscovery(); |
| 51 | boolean isDiscovering(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 52 | |
Jaikumar Ganesh | c53cab2 | 2010-10-26 16:02:26 -0700 | [diff] [blame] | 53 | int getAdapterConnectionState(); |
Jaikumar Ganesh | cb1d354 | 2011-08-19 10:26:32 -0700 | [diff] [blame] | 54 | int getProfileConnectionState(int profile); |
Jaikumar Ganesh | c53cab2 | 2010-10-26 16:02:26 -0700 | [diff] [blame] | 55 | |
Jaikumar Ganesh | e4caddb | 2012-01-25 16:16:48 -0800 | [diff] [blame] | 56 | BluetoothDevice[] getBondedDevices(); |
| 57 | boolean createBond(in BluetoothDevice device); |
| 58 | boolean cancelBondProcess(in BluetoothDevice device); |
| 59 | boolean removeBond(in BluetoothDevice device); |
| 60 | int getBondState(in BluetoothDevice device); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 61 | |
Jaikumar Ganesh | e4caddb | 2012-01-25 16:16:48 -0800 | [diff] [blame] | 62 | String getRemoteName(in BluetoothDevice device); |
Matthew Xie | 33ec984 | 2013-04-03 00:29:27 -0700 | [diff] [blame] | 63 | int getRemoteType(in BluetoothDevice device); |
Jaikumar Ganesh | e4caddb | 2012-01-25 16:16:48 -0800 | [diff] [blame] | 64 | String getRemoteAlias(in BluetoothDevice device); |
| 65 | boolean setRemoteAlias(in BluetoothDevice device, in String name); |
| 66 | int getRemoteClass(in BluetoothDevice device); |
| 67 | ParcelUuid[] getRemoteUuids(in BluetoothDevice device); |
fredc | 4c9caca | 2012-04-06 02:08:46 -0700 | [diff] [blame] | 68 | boolean fetchRemoteUuids(in BluetoothDevice device); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 69 | |
Jaikumar Ganesh | e4caddb | 2012-01-25 16:16:48 -0800 | [diff] [blame] | 70 | boolean setPin(in BluetoothDevice device, boolean accept, int len, in byte[] pinCode); |
| 71 | boolean setPasskey(in BluetoothDevice device, boolean accept, int len, in byte[] |
| 72 | passkey); |
| 73 | boolean setPairingConfirmation(in BluetoothDevice device, boolean accept); |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 74 | |
Jaikumar Ganesh | cb1d354 | 2011-08-19 10:26:32 -0700 | [diff] [blame] | 75 | void sendConnectionStateChange(in BluetoothDevice device, int profile, int state, int prevState); |
zzy | 3b147b7 | 2012-04-03 19:48:32 -0700 | [diff] [blame] | 76 | |
fredc | bf072a7 | 2012-05-09 16:52:50 -0700 | [diff] [blame] | 77 | void registerCallback(in IBluetoothCallback callback); |
| 78 | void unregisterCallback(in IBluetoothCallback callback); |
| 79 | |
zzy | 3b147b7 | 2012-04-03 19:48:32 -0700 | [diff] [blame] | 80 | // For Socket |
| 81 | ParcelFileDescriptor connectSocket(in BluetoothDevice device, int type, in ParcelUuid uuid, int port, int flag); |
| 82 | ParcelFileDescriptor createSocketChannel(int type, in String serviceName, in ParcelUuid uuid, int port, int flag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 83 | } |