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

Commit cc6451dd authored by William Escande's avatar William Escande Committed by Cherrypicker Worker
Browse files

Add missing lock on getSupportedProfile

Bug: 274037299
Test: presubmit tests
(cherry picked from https://android-review.googlesource.com/q/commit:6e179238dc3b3eaa5f8e26c9eff0d891decae5ea)
Merged-In: I993505cd6656d67362eeefd6bd3abd411e8f59ff
Change-Id: I993505cd6656d67362eeefd6bd3abd411e8f59ff
parent 4e73b33c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2952,6 +2952,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) {
@@ -2974,6 +2975,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;
    }