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

Commit 4896cb59 authored by Glenn Kasten's avatar Glenn Kasten Committed by Android (Google) Code Review
Browse files

Merge "Use AUDIO_SESSION_ALLOCATE instead of hard-coded 0"

parents bdc223a7 60bd67f7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -179,7 +179,7 @@ public class AudioRecord
    /**
     * Audio session ID
     */
    private int mSessionId = 0;
    private int mSessionId = AudioSystem.AUDIO_SESSION_ALLOCATE;

    //---------------------------------------------------------
    // Constructor, Finalize
@@ -224,7 +224,7 @@ public class AudioRecord

        // native initialization
        int[] session = new int[1];
        session[0] = 0;
        session[0] = AudioSystem.AUDIO_SESSION_ALLOCATE;
        //TODO: update native initialization when information about hardware init failure
        //      due to capture device already open is available.
        int initResult = native_setup( new WeakReference<AudioRecord>(this),
+3 −0
Original line number Diff line number Diff line
@@ -103,6 +103,9 @@ public class AudioSystem
    /** @deprecated */
    @Deprecated public static final int ROUTE_ALL               = 0xFFFFFFFF;

    // Keep in sync with system/core/include/system/audio.h
    public static final int AUDIO_SESSION_ALLOCATE = 0;

    /*
     * Checks whether the specified stream type is active.
     *
+2 −2
Original line number Diff line number Diff line
@@ -211,7 +211,7 @@ public class AudioTrack
    /**
     * Audio session ID
     */
    private int mSessionId = 0;
    private int mSessionId = AudioSystem.AUDIO_SESSION_ALLOCATE;


    //--------------------------------
@@ -263,7 +263,7 @@ public class AudioTrack
            int bufferSizeInBytes, int mode)
    throws IllegalArgumentException {
        this(streamType, sampleRateInHz, channelConfig, audioFormat,
                bufferSizeInBytes, mode, 0 /*session*/);
                bufferSizeInBytes, mode, AudioSystem.AUDIO_SESSION_ALLOCATE);
    }

    /**