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

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

Merge "Merge "Simplify synchronized code and add comments" am: 9791b54b am:...

Merge "Merge "Simplify synchronized code and add comments" am: 9791b54b am: b57f32e6 am: 9760c427 am: ddf2351c" into rvc-qpr-dev-plus-aosp am: 9d976f06

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1416212

Change-Id: I69b9b2ae48574395e616061093c21e5ea3641570
parents 533448cb 9d976f06
Loading
Loading
Loading
Loading
+8 −9
Original line number Diff line number Diff line
@@ -524,6 +524,7 @@ public class AudioSystem
    /** @hide Media server died. see ErrorCallback */
    public static final int AUDIO_STATUS_SERVER_DIED = 100;

    // all accesses must be synchronized (AudioSystem.class)
    private static ErrorCallback sErrorCallback;

    /** @hide
@@ -560,12 +561,10 @@ public class AudioSystem
    @UnsupportedAppUsage
    private static void errorCallbackFromNative(int error)
    {
        ErrorCallback errorCallback = null;
        ErrorCallback errorCallback;
        synchronized (AudioSystem.class) {
            if (sErrorCallback != null) {
            errorCallback = sErrorCallback;
        }
        }
        if (errorCallback != null) {
            errorCallback.onError(error);
        }
@@ -584,6 +583,7 @@ public class AudioSystem
    //keep in sync with include/media/AudioPolicy.h
    private final static int DYNAMIC_POLICY_EVENT_MIX_STATE_UPDATE = 0;

    // all accesses must be synchronized (AudioSystem.class)
    private static DynamicPolicyCallback sDynPolicyCallback;

    /** @hide */
@@ -598,12 +598,10 @@ public class AudioSystem
    @UnsupportedAppUsage
    private static void dynamicPolicyCallbackFromNative(int event, String regId, int val)
    {
        DynamicPolicyCallback cb = null;
        DynamicPolicyCallback cb;
        synchronized (AudioSystem.class) {
            if (sDynPolicyCallback != null) {
            cb = sDynPolicyCallback;
        }
        }
        if (cb != null) {
            switch(event) {
                case DYNAMIC_POLICY_EVENT_MIX_STATE_UPDATE:
@@ -646,6 +644,7 @@ public class AudioSystem
                        int activeSource, String packName);
    }

    // all accesses must be synchronized (AudioSystem.class)
    private static AudioRecordingCallback sRecordingCallback;

    /** @hide */
@@ -678,7 +677,7 @@ public class AudioSystem
                          int source, int portId, boolean silenced, int[] recordingFormat,
                          AudioEffect.Descriptor[] clientEffects, AudioEffect.Descriptor[] effects,
                          int activeSource) {
        AudioRecordingCallback cb = null;
        AudioRecordingCallback cb;
        synchronized (AudioSystem.class) {
            cb = sRecordingCallback;
        }