1 /* 2 * Copyright 2012 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.IBluetooth; 20 import android.bluetooth.IBluetoothGatt; 21 import android.bluetooth.IBluetoothManagerCallback; 22 import android.bluetooth.IBluetoothProfileServiceConnection; 23 import android.bluetooth.IBluetoothStateChangeCallback; 24 import android.content.AttributionSource; 25 26 /** 27 * System private API for talking with the Bluetooth service. 28 * 29 * {@hide} 30 */ 31 interface IBluetoothManager 32 { 33 @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission") registerAdapter(in IBluetoothManagerCallback callback)34 IBluetooth registerAdapter(in IBluetoothManagerCallback callback); 35 @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission") unregisterAdapter(in IBluetoothManagerCallback callback)36 void unregisterAdapter(in IBluetoothManagerCallback callback); 37 @UnsupportedAppUsage registerStateChangeCallback(in IBluetoothStateChangeCallback callback)38 void registerStateChangeCallback(in IBluetoothStateChangeCallback callback); 39 @UnsupportedAppUsage unregisterStateChangeCallback(in IBluetoothStateChangeCallback callback)40 void unregisterStateChangeCallback(in IBluetoothStateChangeCallback callback); 41 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") enable(in AttributionSource attributionSource)42 boolean enable(in AttributionSource attributionSource); 43 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") enableNoAutoConnect(in AttributionSource attributionSource)44 boolean enableNoAutoConnect(in AttributionSource attributionSource); 45 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") disable(in AttributionSource attributionSource, boolean persist)46 boolean disable(in AttributionSource attributionSource, boolean persist); 47 @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission") getState()48 int getState(); 49 @UnsupportedAppUsage 50 @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission") getBluetoothGatt()51 IBluetoothGatt getBluetoothGatt(); 52 53 @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission") bindBluetoothProfileService(int profile, IBluetoothProfileServiceConnection proxy)54 boolean bindBluetoothProfileService(int profile, IBluetoothProfileServiceConnection proxy); 55 @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission") unbindBluetoothProfileService(int profile, IBluetoothProfileServiceConnection proxy)56 void unbindBluetoothProfileService(int profile, IBluetoothProfileServiceConnection proxy); 57 58 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.LOCAL_MAC_ADDRESS})") getAddress(in AttributionSource attributionSource)59 String getAddress(in AttributionSource attributionSource); 60 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") getName(in AttributionSource attributionSource)61 String getName(in AttributionSource attributionSource); 62 63 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") onFactoryReset(in AttributionSource attributionSource)64 boolean onFactoryReset(in AttributionSource attributionSource); 65 66 @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission") isBleScanAlwaysAvailable()67 boolean isBleScanAlwaysAvailable(); 68 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") enableBle(in AttributionSource attributionSource, IBinder b)69 boolean enableBle(in AttributionSource attributionSource, IBinder b); 70 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") disableBle(in AttributionSource attributionSource, IBinder b)71 boolean disableBle(in AttributionSource attributionSource, IBinder b); 72 @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission") isBleAppPresent()73 boolean isBleAppPresent(); 74 @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission") isHearingAidProfileSupported()75 boolean isHearingAidProfileSupported(); 76 77 @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission") getSystemConfigEnabledProfilesForPackage(String packageName)78 List<String> getSystemConfigEnabledProfilesForPackage(String packageName); 79 } 80