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

Commit 4aa41500 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6174197 from fe830f9760ca39e90e4f014eee74e53482c9e1c8 to rvc-release

Change-Id: If870cd76d591528113d2a70619bab099d642f497
parents a352f480 f6b1a534
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -2161,6 +2161,33 @@ public final class BluetoothAdapter {
        }
    }

    /**
     * Fetches a list of the most recently connected bluetooth devices ordered by how recently they
     * were connected with most recently first and least recently last
     *
     * @return {@link List} of bonded {@link BluetoothDevice} ordered by how recently they were
     * connected
     *
     * @hide
     */
    @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
    public @NonNull List<BluetoothDevice> getMostRecentlyConnectedDevices() {
        if (getState() != STATE_ON) {
            return new ArrayList<>();
        }
        try {
            mServiceLock.readLock().lock();
            if (mService != null) {
                return mService.getMostRecentlyConnectedDevices();
            }
        } catch (RemoteException e) {
            Log.e(TAG, "", e);
        } finally {
            mServiceLock.readLock().unlock();
        }
        return new ArrayList<>();
    }

    /**
     * Return the set of {@link BluetoothDevice} objects that are bonded
     * (paired) to the local adapter.
+1 −1
Original line number Diff line number Diff line
@@ -706,7 +706,7 @@ public final class BluetoothHidDevice implements BluetoothProfile {
     * @hide
     */
    @SystemApi
    @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
    @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
    public boolean setConnectionPolicy(@NonNull BluetoothDevice device,
            @ConnectionPolicy int connectionPolicy) {
        log("setConnectionPolicy(" + device + ", " + connectionPolicy + ")");