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 { 33 boolean isEnabled(); 34 int getState(); 35 boolean enable(); 36 boolean enableNoAutoConnect(); 37 boolean disable(); 38 39 String getAddress(); 40 ParcelUuid[] getUuids(); 41 boolean setName(in String name); 42 String getName(); 43 44 int getScanMode(); 45 boolean setScanMode(int mode, int duration); 46 47 int getDiscoverableTimeout(); 48 boolean setDiscoverableTimeout(int timeout); 49 50 boolean startDiscovery(); 51 boolean cancelDiscovery(); 52 boolean isDiscovering(); 53 54 int getAdapterConnectionState(); 55 int getProfileConnectionState(int profile); 56 57 BluetoothDevice[] getBondedDevices(); 58 boolean createBond(in BluetoothDevice device, in int transport); 59 boolean cancelBondProcess(in BluetoothDevice device); 60 boolean removeBond(in BluetoothDevice device); 61 int getBondState(in BluetoothDevice device); 62 int getConnectionState(in BluetoothDevice device); 63 64 String getRemoteName(in BluetoothDevice device); 65 int getRemoteType(in BluetoothDevice device); 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); 70 boolean fetchRemoteUuids(in BluetoothDevice device); 71 boolean fetchRemoteMasInstances(in BluetoothDevice device); 72 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); 77 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 83 void sendConnectionStateChange(in BluetoothDevice device, int profile, int state, int prevState); 84 85 void registerCallback(in IBluetoothCallback callback); 86 void unregisterCallback(in IBluetoothCallback callback); 87 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); 91 92 boolean configHciSnoopLog(boolean enable); 93 94 boolean isMultiAdvertisementSupported(); 95 boolean isPeripheralModeSupported(); 96 boolean isOffloadedFilteringSupported(); 97 boolean isOffloadedScanBatchingSupported(); 98 boolean isActivityAndEnergyReportingSupported(); 99 void getActivityEnergyInfoFromController(); 100 BluetoothActivityEnergyInfo reportActivityInfo(); 101 102 // for dumpsys support 103 String dump(); 104 } 105