1 /*
2  * Copyright (C) 2024 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.app.PendingIntent;
20 import android.bluetooth.BluetoothDevice;
21 import android.bluetooth.le.ScanFilter;
22 import android.bluetooth.le.ScanSettings;
23 import android.bluetooth.le.ScanResult;
24 import android.content.AttributionSource;
25 import android.os.WorkSource;
26 
27 import android.bluetooth.le.IScannerCallback;
28 import android.bluetooth.le.IPeriodicAdvertisingCallback;
29 
30 /**
31  * API for interacting with BLE Scan
32  * @hide
33  */
34 interface IBluetoothScan {
35     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN)")
registerScanner(in IScannerCallback callback, in WorkSource workSource, in AttributionSource attributionSource)36     void registerScanner(in IScannerCallback callback, in WorkSource workSource, in AttributionSource attributionSource);
37     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN)")
unregisterScanner(in int scannerId, in AttributionSource attributionSource)38     void unregisterScanner(in int scannerId, in AttributionSource attributionSource);
39     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN)")
startScan(in int scannerId, in ScanSettings settings, in List<ScanFilter> filters, in AttributionSource attributionSource)40     void startScan(in int scannerId, in ScanSettings settings, in List<ScanFilter> filters,
41                    in AttributionSource attributionSource);
42     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN)")
startScanForIntent(in PendingIntent intent, in ScanSettings settings, in List<ScanFilter> filters, in AttributionSource attributionSource)43     void startScanForIntent(in PendingIntent intent, in ScanSettings settings, in List<ScanFilter> filters,
44                             in AttributionSource attributionSource);
45     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN)")
stopScan(in int scannerId, in AttributionSource attributionSource)46     void stopScan(in int scannerId, in AttributionSource attributionSource);
47     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN)")
stopScanForIntent(in PendingIntent intent, in AttributionSource attributionSource)48     void stopScanForIntent(in PendingIntent intent, in AttributionSource attributionSource);
49     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN)")
flushPendingBatchResults(in int scannerId, in AttributionSource attributionSource)50     void flushPendingBatchResults(in int scannerId, in AttributionSource attributionSource);
51 
52     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN)")
registerSync(in ScanResult scanResult, in int skip, in int timeout, in IPeriodicAdvertisingCallback callback, in AttributionSource attributionSource)53     void registerSync(in ScanResult scanResult, in int skip, in int timeout, in IPeriodicAdvertisingCallback callback, in AttributionSource attributionSource);
54     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN)")
unregisterSync(in IPeriodicAdvertisingCallback callback, in AttributionSource attributionSource)55     void unregisterSync(in IPeriodicAdvertisingCallback callback, in AttributionSource attributionSource);
56     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN)")
transferSync(in BluetoothDevice bda, in int serviceData, in int syncHandle, in AttributionSource attributionSource)57     void transferSync(in BluetoothDevice bda, in int serviceData, in int syncHandle, in AttributionSource attributionSource);
58     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN)")
transferSetInfo(in BluetoothDevice bda, in int serviceData, in int advertisingHandle, in IPeriodicAdvertisingCallback callback, in AttributionSource attributionSource)59     void transferSetInfo(in BluetoothDevice bda, in int serviceData, in int advertisingHandle, in IPeriodicAdvertisingCallback callback,  in AttributionSource attributionSource);
60 
61     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
numHwTrackFiltersAvailable(in AttributionSource attributionSource)62     int numHwTrackFiltersAvailable(in AttributionSource attributionSource);
63 }
64