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

Commit d55a06e7 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

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

Change-Id: I13c0b1971516bbf829aa3a11427eb93287f30fd9
parents 371ab666 29827d59
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