Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a332622a authored by Oli Lan's avatar Oli Lan
Browse files

Add AttributionSource param to bluetooth scanning methods.

This adds an AttributionSource parameter to the AdapterService and
GattService methods that perform scanning or discovery.

Bug: 183203469
Test: atest GattServiceTest
Test: atest AdapterServiceTest
Test: atest CtsPermissionTestCases:android.permission.cts.NearbyDevicesPermissionTest
Change-Id: I2e8351786597437c88f128709c81255b87599a7e
parent 2c1f03d0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.bluetooth.BluetoothActivityEnergyInfo;
import android.bluetooth.BluetoothClass;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.OobData;
import android.content.AttributionSource;
import android.os.ParcelUuid;
import android.os.ParcelFileDescriptor;
import android.os.ResultReceiver;
@@ -59,7 +60,7 @@ interface IBluetooth
    int getDiscoverableTimeout();
    boolean setDiscoverableTimeout(int timeout);

    boolean startDiscovery(String callingPackage, String callingFeatureId);
    boolean startDiscovery(in AttributionSource attributionSource);
    boolean cancelDiscovery();
    boolean isDiscovering();
    long getDiscoveryEndMillis();
+4 −3
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.bluetooth.le.ScanFilter;
import android.bluetooth.le.ScanResult;
import android.bluetooth.le.ScanSettings;
import android.bluetooth.le.ResultStorageDescriptor;
import android.content.AttributionSource;
import android.os.ParcelUuid;
import android.os.WorkSource;

@@ -46,10 +47,10 @@ interface IBluetoothGatt {
    void registerScanner(in IScannerCallback callback, in WorkSource workSource);
    void unregisterScanner(in int scannerId);
    void startScan(in int scannerId, in ScanSettings settings, in List<ScanFilter> filters,
                   in List scanStorages, in String callingPackage, String callingFeatureId);
                   in List scanStorages, in AttributionSource attributionSource);
    void startScanForIntent(in PendingIntent intent, in ScanSettings settings, in List<ScanFilter> filters,
                            in String callingPackage, String callingFeatureId);
    void stopScanForIntent(in PendingIntent intent, in String callingPackage);
                            in AttributionSource attributionSource);
    void stopScanForIntent(in PendingIntent intent);
    void stopScan(in int scannerId);
    void flushPendingBatchResults(in int scannerId);