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); getConnectionState(in BluetoothDevice device)62 int getConnectionState(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); sdpSearch(in BluetoothDevice device, in ParcelUuid uuid)71 boolean sdpSearch(in BluetoothDevice device, in ParcelUuid uuid); 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); getSimAccessPermission(in BluetoothDevice device)82 int getSimAccessPermission(in BluetoothDevice device); setSimAccessPermission(in BluetoothDevice device, int value)83 boolean setSimAccessPermission(in BluetoothDevice device, int value); 84 sendConnectionStateChange(in BluetoothDevice device, int profile, int state, int prevState)85 void sendConnectionStateChange(in BluetoothDevice device, int profile, int state, int prevState); 86 registerCallback(in IBluetoothCallback callback)87 void registerCallback(in IBluetoothCallback callback); unregisterCallback(in IBluetoothCallback callback)88 void unregisterCallback(in IBluetoothCallback callback); 89 90 // For Socket connectSocket(in BluetoothDevice device, int type, in ParcelUuid uuid, int port, int flag)91 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)92 ParcelFileDescriptor createSocketChannel(int type, in String serviceName, in ParcelUuid uuid, int port, int flag); 93 configHciSnoopLog(boolean enable)94 boolean configHciSnoopLog(boolean enable); factoryReset()95 boolean factoryReset(); 96 isMultiAdvertisementSupported()97 boolean isMultiAdvertisementSupported(); isPeripheralModeSupported()98 boolean isPeripheralModeSupported(); isOffloadedFilteringSupported()99 boolean isOffloadedFilteringSupported(); isOffloadedScanBatchingSupported()100 boolean isOffloadedScanBatchingSupported(); isActivityAndEnergyReportingSupported()101 boolean isActivityAndEnergyReportingSupported(); getActivityEnergyInfoFromController()102 void getActivityEnergyInfoFromController(); reportActivityInfo()103 BluetoothActivityEnergyInfo reportActivityInfo(); 104 105 // For dumpsys support dump(in ParcelFileDescriptor fd)106 void dump(in ParcelFileDescriptor fd); onLeServiceUp()107 void onLeServiceUp(); onBrEdrDown()108 void onBrEdrDown(); 109 } 110