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

Commit bae181fa authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add missing lock on getSupportedProfile" into tm-qpr-dev

parents 0742a03c cc6451dd
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;
    }