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

Commit 1e2d5cb0 authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

LE Maximum Advertising Data Length (1/4)

Add ability to check maximum advertising data length.

Bug: 30622771
Test: manual
Change-Id: I281f7e9f294c40a47a67a22809cc753b6693f7c4
parent 88b7599e
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -1482,6 +1482,25 @@ public final class BluetoothAdapter {
        return false;
    }

    /**
     * Return the maximum LE advertising data length,
     * if LE Extended Advertising feature is supported.
     *
     * @return the maximum LE advertising data length.
     */
    public int getLeMaximumAdvertisingDataLength() {
        if (!getLeAccess()) return 0;
        try {
            mServiceLock.readLock().lock();
            if (mService != null) return mService.getLeMaximumAdvertisingDataLength();
        } catch (RemoteException e) {
            Log.e(TAG, "failed to get getLeMaximumAdvertisingDataLength, error: ", e);
        } finally {
            mServiceLock.readLock().unlock();
        }
        return 0;
    }

    /**
     * Return true if hardware has entries available for matching beacons
     *
+1 −0
Original line number Diff line number Diff line
@@ -108,6 +108,7 @@ interface IBluetooth
    boolean isLeCodedPhySupported();
    boolean isLeExtendedAdvertisingSupported();
    boolean isLePeriodicAdvertisingSupported();
    int getLeMaximumAdvertisingDataLength();
    BluetoothActivityEnergyInfo reportActivityInfo();

    /**