1 /* 2 * Copyright 2022 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.BluetoothDevice; 20 import android.bluetooth.BluetoothLeBroadcastMetadata; 21 import android.bluetooth.BluetoothLeBroadcastReceiveState; 22 import android.bluetooth.IBluetoothLeBroadcastAssistantCallback; 23 import android.bluetooth.le.ScanFilter; 24 25 /** 26 * APIs for Bluetooth LE Audio Broadcast Assistant service 27 * 28 * @hide 29 */ 30 interface IBluetoothLeBroadcastAssistant { 31 // Public API 32 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") getConnectionState(in BluetoothDevice sink)33 int getConnectionState(in BluetoothDevice sink); 34 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") getDevicesMatchingConnectionStates(in int[] states)35 List<BluetoothDevice> getDevicesMatchingConnectionStates(in int[] states); 36 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") getConnectedDevices()37 List<BluetoothDevice> getConnectedDevices(); 38 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") setConnectionPolicy(in BluetoothDevice device, int connectionPolicy)39 boolean setConnectionPolicy(in BluetoothDevice device, int connectionPolicy); 40 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") getConnectionPolicy(in BluetoothDevice device)41 int getConnectionPolicy(in BluetoothDevice device); 42 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") registerCallback(in IBluetoothLeBroadcastAssistantCallback cb)43 void registerCallback(in IBluetoothLeBroadcastAssistantCallback cb); 44 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") unregisterCallback(in IBluetoothLeBroadcastAssistantCallback cb)45 void unregisterCallback(in IBluetoothLeBroadcastAssistantCallback cb); 46 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") startSearchingForSources(in List<ScanFilter> filters)47 void startSearchingForSources(in List<ScanFilter> filters); 48 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") stopSearchingForSources()49 void stopSearchingForSources(); 50 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") isSearchInProgress()51 boolean isSearchInProgress(); 52 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") addSource(in BluetoothDevice sink, in BluetoothLeBroadcastMetadata sourceMetadata, in boolean isGroupOp)53 void addSource(in BluetoothDevice sink, in BluetoothLeBroadcastMetadata sourceMetadata, in boolean isGroupOp); 54 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") modifySource(in BluetoothDevice sink, in int sourceId, in BluetoothLeBroadcastMetadata updatedMetadata)55 void modifySource(in BluetoothDevice sink, in int sourceId, in BluetoothLeBroadcastMetadata updatedMetadata); 56 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") removeSource(in BluetoothDevice sink, in int sourceId)57 void removeSource(in BluetoothDevice sink, in int sourceId); 58 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})") getAllSources(in BluetoothDevice sink)59 List<BluetoothLeBroadcastReceiveState> getAllSources(in BluetoothDevice sink); getMaximumSourceCapacity(in BluetoothDevice sink)60 int getMaximumSourceCapacity(in BluetoothDevice sink); 61 } 62