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

Commit 29827d59 authored by Ytai Ben-tsvi's avatar Ytai Ben-tsvi Committed by Android (Google) Code Review
Browse files

Merge "Fix deadlock between audio policy manager and sound trigger m/w" into rvc-dev

parents 062f7a09 f1bf8122
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -203,9 +203,13 @@ public class SoundTriggerMiddlewareValidation implements ISoundTriggerMiddleware
        checkPreemptPermissions();
        // Input validation (always valid).

        synchronized (this) {
        // State validation (always valid).

        // Normally, we would acquire a lock here. However, we do not access any state here so it
        // is safe to not lock. This call is typically done from a different context than all the
        // other calls and may result in a deadlock if we lock here (between the audio server and
        // the system server).

        // From here on, every exception isn't client's fault.
        try {
            mDelegate.setExternalCaptureState(active);
@@ -213,7 +217,6 @@ public class SoundTriggerMiddlewareValidation implements ISoundTriggerMiddleware
            throw handleException(e);
        }
    }
    }

    // Override toString() in order to have the delegate's ID in it.
    @Override