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

Commit 6e179238 authored by William Escande's avatar William Escande
Browse files

Add missing lock on getSupportedProfile

Bug: 274037299
Test: presubmit tests
Change-Id: I993505cd6656d67362eeefd6bd3abd411e8f59ff
parent 06a99616
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3095,6 +3095,7 @@ public final class BluetoothAdapter {
    public @NonNull List<Integer> getSupportedProfiles() {
        final ArrayList<Integer> supportedProfiles = new ArrayList<Integer>();

        mServiceLock.readLock().lock();
        try {
            synchronized (mManagerCallback) {
                if (mService != null) {
@@ -3117,6 +3118,8 @@ public final class BluetoothAdapter {
            }
        } catch (RemoteException | TimeoutException e) {
            Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
        } finally {
            mServiceLock.readLock().unlock();
        }
        return supportedProfiles;
    }