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

Commit b09707a0 authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Make mInitializationLooper final

This emphasizes that it doesn't change after construction,
and will prevent accidental modification in the future.

Change-Id: I18a2cecda79bd936967de26cdaaa7b731559545d
parent 3251d363
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ public class AudioTrack
    /**
     * Looper associated with the thread that creates the AudioTrack instance.
     */
    private Looper mInitializationLooper = null;
    private final Looper mInitializationLooper;
    /**
     * The audio data sampling rate in Hz.
     */
@@ -308,9 +308,11 @@ public class AudioTrack
        mState = STATE_UNINITIALIZED;

        // remember which looper is associated with the AudioTrack instantiation
        if ((mInitializationLooper = Looper.myLooper()) == null) {
            mInitializationLooper = Looper.getMainLooper();
        Looper looper;
        if ((looper = Looper.myLooper()) == null) {
            looper = Looper.getMainLooper();
        }
        mInitializationLooper = looper;

        audioParamCheck(streamType, sampleRateInHz, channelConfig, audioFormat, mode);