Remove redundant initializers from WebRTC Java code.
Removes redundant field initializers such as null, 0 and false.
Bug: webrtc:9742
Change-Id: I1e54f6c6000885cf95f7af8e2701875a78445497
Reviewed-on: https://webrtc-review.googlesource.com/99481
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24676}
diff --git a/sdk/android/api/org/webrtc/DataChannel.java b/sdk/android/api/org/webrtc/DataChannel.java
index 6b03409..53ea0d8 100644
--- a/sdk/android/api/org/webrtc/DataChannel.java
+++ b/sdk/android/api/org/webrtc/DataChannel.java
@@ -22,7 +22,7 @@
// Optional unsigned short in WebIDL, -1 means unspecified.
public int maxRetransmits = -1;
public String protocol = "";
- public boolean negotiated = false;
+ public boolean negotiated;
// Optional unsigned short in WebIDL, -1 means unspecified.
public int id = -1;
diff --git a/sdk/android/api/org/webrtc/MediaCodecVideoDecoder.java b/sdk/android/api/org/webrtc/MediaCodecVideoDecoder.java
index aa87cdb..ec65475 100644
--- a/sdk/android/api/org/webrtc/MediaCodecVideoDecoder.java
+++ b/sdk/android/api/org/webrtc/MediaCodecVideoDecoder.java
@@ -21,9 +21,9 @@
import android.view.Surface;
import java.nio.ByteBuffer;
import java.util.ArrayDeque;
-import java.util.HashMap;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Queue;
@@ -156,9 +156,9 @@
private static final int MAX_QUEUED_OUTPUTBUFFERS = 3;
// Active running decoder instance. Set in initDecode() (called from native code)
// and reset to null in release() call.
- @Nullable private static MediaCodecVideoDecoder runningInstance = null;
- @Nullable private static MediaCodecVideoDecoderErrorCallback errorCallback = null;
- private static int codecErrors = 0;
+ @Nullable private static MediaCodecVideoDecoder runningInstance;
+ @Nullable private static MediaCodecVideoDecoderErrorCallback errorCallback;
+ private static int codecErrors;
// List of disabled codec types - can be set from application.
private static Set<String> hwDecoderDisabledTypes = new HashSet<String>();
@Nullable private static EglBase eglBase;
@@ -228,7 +228,7 @@
// The below variables are only used when decoding to a Surface.
@Nullable private TextureListener textureListener;
private int droppedFrames;
- @Nullable private Surface surface = null;
+ @Nullable private Surface surface;
private final Queue<DecodedOutputBuffer> dequeuedSurfaceOutputBuffers =
new ArrayDeque<DecodedOutputBuffer>();
diff --git a/sdk/android/api/org/webrtc/MediaCodecVideoEncoder.java b/sdk/android/api/org/webrtc/MediaCodecVideoEncoder.java
index 5846e70..38054c6 100644
--- a/sdk/android/api/org/webrtc/MediaCodecVideoEncoder.java
+++ b/sdk/android/api/org/webrtc/MediaCodecVideoEncoder.java
@@ -23,8 +23,8 @@
import android.view.Surface;
import java.nio.ByteBuffer;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -164,9 +164,9 @@
// Active running encoder instance. Set in initEncode() (called from native code)
// and reset to null in release() call.
- @Nullable private static MediaCodecVideoEncoder runningInstance = null;
- @Nullable private static MediaCodecVideoEncoderErrorCallback errorCallback = null;
- private static int codecErrors = 0;
+ @Nullable private static MediaCodecVideoEncoder runningInstance;
+ @Nullable private static MediaCodecVideoEncoderErrorCallback errorCallback;
+ private static int codecErrors;
// List of disabled codec types - can be set from application.
private static Set<String> hwEncoderDisabledTypes = new HashSet<String>();
@Nullable private static EglBase staticEglBase;
@@ -348,7 +348,7 @@
private long lastKeyFrameMs;
// SPS and PPS NALs (Config frame) for H.264.
- @Nullable private ByteBuffer configData = null;
+ @Nullable private ByteBuffer configData;
// MediaCodec error handler - invoked when critical error happens which may prevent
// further use of media codec API. Now it means that one of media codec instances
diff --git a/sdk/android/api/org/webrtc/NetworkMonitorAutoDetect.java b/sdk/android/api/org/webrtc/NetworkMonitorAutoDetect.java
index d8c8344..491e6fa 100644
--- a/sdk/android/api/org/webrtc/NetworkMonitorAutoDetect.java
+++ b/sdk/android/api/org/webrtc/NetworkMonitorAutoDetect.java
@@ -526,7 +526,7 @@
private final Observer observer;
// Network information about a WifiP2p (aka WiFi-Direct) network, or null if no such network is
// connected.
- @Nullable private NetworkInformation wifiP2pNetworkInfo = null;
+ @Nullable private NetworkInformation wifiP2pNetworkInfo;
WifiDirectManagerDelegate(Observer observer, Context context) {
this.context = context;
diff --git a/sdk/android/api/org/webrtc/PeerConnectionFactory.java b/sdk/android/api/org/webrtc/PeerConnectionFactory.java
index 8dd2429..672bd0e 100644
--- a/sdk/android/api/org/webrtc/PeerConnectionFactory.java
+++ b/sdk/android/api/org/webrtc/PeerConnectionFactory.java
@@ -29,7 +29,7 @@
private static final String VIDEO_CAPTURER_THREAD_NAME = "VideoCapturerThread";
private final long nativeFactory;
- private static volatile boolean internalTracerInitialized = false;
+ private static volatile boolean internalTracerInitialized;
@Nullable private static Thread networkThread;
@Nullable private static Thread workerThread;
@Nullable private static Thread signalingThread;
@@ -63,11 +63,11 @@
public static class Builder {
private final Context applicationContext;
private String fieldTrials = "";
- private boolean enableInternalTracer = false;
+ private boolean enableInternalTracer;
private NativeLibraryLoader nativeLibraryLoader = new NativeLibrary.DefaultLoader();
private String nativeLibraryName = "jingle_peerconnection_so";
- @Nullable private Loggable loggable = null;
- @Nullable private Severity loggableSeverity = null;
+ @Nullable private Loggable loggable;
+ @Nullable private Severity loggableSeverity;
Builder(Context applicationContext) {
this.applicationContext = applicationContext;
diff --git a/sdk/android/api/org/webrtc/ScreenCapturerAndroid.java b/sdk/android/api/org/webrtc/ScreenCapturerAndroid.java
index a13f871..2528460 100644
--- a/sdk/android/api/org/webrtc/ScreenCapturerAndroid.java
+++ b/sdk/android/api/org/webrtc/ScreenCapturerAndroid.java
@@ -47,9 +47,9 @@
@Nullable private VirtualDisplay virtualDisplay;
@Nullable private SurfaceTextureHelper surfaceTextureHelper;
@Nullable private CapturerObserver capturerObserver;
- private long numCapturedFrames = 0;
+ private long numCapturedFrames;
@Nullable private MediaProjection mediaProjection;
- private boolean isDisposed = false;
+ private boolean isDisposed;
@Nullable private MediaProjectionManager mediaProjectionManager;
/**
diff --git a/sdk/android/api/org/webrtc/SurfaceEglRenderer.java b/sdk/android/api/org/webrtc/SurfaceEglRenderer.java
index 350a4cb..dfda8cb 100644
--- a/sdk/android/api/org/webrtc/SurfaceEglRenderer.java
+++ b/sdk/android/api/org/webrtc/SurfaceEglRenderer.java
@@ -28,7 +28,7 @@
private RendererCommon.RendererEvents rendererEvents;
private final Object layoutLock = new Object();
- private boolean isRenderingPaused = false;
+ private boolean isRenderingPaused;
private boolean isFirstFrameRendered;
private int rotatedFrameWidth;
private int rotatedFrameHeight;
diff --git a/sdk/android/api/org/webrtc/SurfaceTextureHelper.java b/sdk/android/api/org/webrtc/SurfaceTextureHelper.java
index decdd05..bb67d1f9 100644
--- a/sdk/android/api/org/webrtc/SurfaceTextureHelper.java
+++ b/sdk/android/api/org/webrtc/SurfaceTextureHelper.java
@@ -71,9 +71,9 @@
// These variables are only accessed from the |handler| thread.
@Nullable private VideoSink listener;
// The possible states of this class.
- private boolean hasPendingTexture = false;
- private volatile boolean isTextureInUse = false;
- private boolean isQuitting = false;
+ private boolean hasPendingTexture;
+ private volatile boolean isTextureInUse;
+ private boolean isQuitting;
private int frameRotation;
private int textureWidth;
private int textureHeight;
diff --git a/sdk/android/instrumentationtests/src/org/webrtc/CameraVideoCapturerTestFixtures.java b/sdk/android/instrumentationtests/src/org/webrtc/CameraVideoCapturerTestFixtures.java
index 17702c3..dd0d780 100644
--- a/sdk/android/instrumentationtests/src/org/webrtc/CameraVideoCapturerTestFixtures.java
+++ b/sdk/android/instrumentationtests/src/org/webrtc/CameraVideoCapturerTestFixtures.java
@@ -39,9 +39,9 @@
static private class RendererCallbacks implements VideoSink {
private final Object frameLock = new Object();
- private int framesRendered = 0;
- private int width = 0;
- private int height = 0;
+ private int framesRendered;
+ private int width;
+ private int height;
@Override
public void onFrame(VideoFrame frame) {
@@ -102,7 +102,7 @@
}
static private class FakeCapturerObserver implements CapturerObserver {
- private int framesCaptured = 0;
+ private int framesCaptured;
private @Nullable VideoFrame videoFrame;
final private Object frameLock = new Object();
final private Object capturerStartLock = new Object();
diff --git a/sdk/android/instrumentationtests/src/org/webrtc/HardwareVideoEncoderTest.java b/sdk/android/instrumentationtests/src/org/webrtc/HardwareVideoEncoderTest.java
index fb27506..729dcbb 100644
--- a/sdk/android/instrumentationtests/src/org/webrtc/HardwareVideoEncoderTest.java
+++ b/sdk/android/instrumentationtests/src/org/webrtc/HardwareVideoEncoderTest.java
@@ -272,7 +272,7 @@
// # Test fields
private final Object referencedFramesLock = new Object();
- private int referencedFrames = 0;
+ private int referencedFrames;
private Runnable releaseFrameCallback = new Runnable() {
@Override
diff --git a/sdk/android/instrumentationtests/src/org/webrtc/NetworkMonitorTest.java b/sdk/android/instrumentationtests/src/org/webrtc/NetworkMonitorTest.java
index e4a0e6a..c40c75e 100644
--- a/sdk/android/instrumentationtests/src/org/webrtc/NetworkMonitorTest.java
+++ b/sdk/android/instrumentationtests/src/org/webrtc/NetworkMonitorTest.java
@@ -58,7 +58,7 @@
* Listens for alerts fired by the NetworkMonitor when network status changes.
*/
private static class NetworkMonitorTestObserver implements NetworkMonitor.NetworkObserver {
- private boolean receivedNotification = false;
+ private boolean receivedNotification;
@Override
public void onConnectionTypeChanged(ConnectionType connectionType) {
@@ -159,7 +159,7 @@
}
private static final Object lock = new Object();
- private static @Nullable Handler uiThreadHandler = null;
+ private static @Nullable Handler uiThreadHandler;
private NetworkMonitorAutoDetect receiver;
private MockConnectivityManagerDelegate connectivityDelegate;
diff --git a/sdk/android/instrumentationtests/src/org/webrtc/PeerConnectionTest.java b/sdk/android/instrumentationtests/src/org/webrtc/PeerConnectionTest.java
index 863bca7..f1e2792 100644
--- a/sdk/android/instrumentationtests/src/org/webrtc/PeerConnectionTest.java
+++ b/sdk/android/instrumentationtests/src/org/webrtc/PeerConnectionTest.java
@@ -50,7 +50,7 @@
@RunWith(BaseJUnit4ClassRunner.class)
public class PeerConnectionTest {
private static final int TIMEOUT_SECONDS = 20;
- private @Nullable TreeSet<String> threadsBeforeTest = null;
+ private @Nullable TreeSet<String> threadsBeforeTest;
@Before
public void setUp() {
@@ -64,13 +64,13 @@
implements PeerConnection.Observer, VideoSink, DataChannel.Observer, StatsObserver,
RTCStatsCollectorCallback, RtpReceiver.Observer {
private final String name;
- private int expectedIceCandidates = 0;
- private int expectedErrors = 0;
- private int expectedRenegotiations = 0;
- private int expectedWidth = 0;
- private int expectedHeight = 0;
- private int expectedFramesDelivered = 0;
- private int expectedTracksAdded = 0;
+ private int expectedIceCandidates;
+ private int expectedErrors;
+ private int expectedRenegotiations;
+ private int expectedWidth;
+ private int expectedHeight;
+ private int expectedFramesDelivered;
+ private int expectedTracksAdded;
private Queue<SignalingState> expectedSignalingChanges = new ArrayDeque<>();
private Queue<IceConnectionState> expectedIceConnectionChanges = new ArrayDeque<>();
private Queue<IceGatheringState> expectedIceGatheringChanges = new ArrayDeque<>();
@@ -82,12 +82,12 @@
private Queue<DataChannel.Buffer> expectedBuffers = new ArrayDeque<>();
private Queue<DataChannel.State> expectedStateChanges = new ArrayDeque<>();
private Queue<String> expectedRemoteDataChannelLabels = new ArrayDeque<>();
- private int expectedOldStatsCallbacks = 0;
- private int expectedNewStatsCallbacks = 0;
+ private int expectedOldStatsCallbacks;
+ private int expectedNewStatsCallbacks;
private List<StatsReport[]> gotStatsReports = new ArrayList<>();
private final HashSet<MediaStream> gotRemoteStreams = new HashSet<>();
- private int expectedFirstAudioPacket = 0;
- private int expectedFirstVideoPacket = 0;
+ private int expectedFirstAudioPacket;
+ private int expectedFirstVideoPacket;
public ObserverExpectations(String name) {
this.name = name;
@@ -532,9 +532,9 @@
}
private static class SdpObserverLatch implements SdpObserver {
- private boolean success = false;
- private @Nullable SessionDescription sdp = null;
- private @Nullable String error = null;
+ private boolean success;
+ private @Nullable SessionDescription sdp;
+ private @Nullable String error;
private CountDownLatch latch = new CountDownLatch(1);
public SdpObserverLatch() {}
@@ -1444,7 +1444,7 @@
final VideoTrack videoTrack = factory.createVideoTrack("video", videoSource);
class FrameCounter implements VideoSink {
- private int count = 0;
+ private int count;
public int getCount() {
return count;
diff --git a/sdk/android/src/java/org/webrtc/AndroidVideoDecoder.java b/sdk/android/src/java/org/webrtc/AndroidVideoDecoder.java
index a756828..c9ed406 100644
--- a/sdk/android/src/java/org/webrtc/AndroidVideoDecoder.java
+++ b/sdk/android/src/java/org/webrtc/AndroidVideoDecoder.java
@@ -85,8 +85,8 @@
// caller and must be used to call initDecode, decode, and release.
private ThreadChecker decoderThreadChecker;
- private volatile boolean running = false;
- @Nullable private volatile Exception shutdownException = null;
+ private volatile boolean running;
+ @Nullable private volatile Exception shutdownException;
// Dimensions (width, height, stride, and sliceHeight) may be accessed by either the decode thread
// or the output thread. Accesses should be protected with this lock.
@@ -107,7 +107,7 @@
private final @Nullable EglBase.Context sharedContext;
// Valid and immutable while the decoder is running.
@Nullable private SurfaceTextureHelper surfaceTextureHelper;
- @Nullable private Surface surface = null;
+ @Nullable private Surface surface;
private static class DecodedTextureMetadata {
final long presentationTimestampUs;
@@ -128,7 +128,7 @@
@Nullable private Callback callback;
// Valid and immutable while the decoder is running.
- @Nullable private MediaCodecWrapper codec = null;
+ @Nullable private MediaCodecWrapper codec;
AndroidVideoDecoder(MediaCodecWrapperFactory mediaCodecWrapperFactory, String codecName,
VideoCodecType codecType, int colorFormat, @Nullable EglBase.Context sharedContext) {
diff --git a/sdk/android/src/java/org/webrtc/BaseBitrateAdjuster.java b/sdk/android/src/java/org/webrtc/BaseBitrateAdjuster.java
index 19cf5ea..0754734 100644
--- a/sdk/android/src/java/org/webrtc/BaseBitrateAdjuster.java
+++ b/sdk/android/src/java/org/webrtc/BaseBitrateAdjuster.java
@@ -12,8 +12,8 @@
/** BitrateAdjuster that tracks bitrate and framerate but does not adjust them. */
class BaseBitrateAdjuster implements BitrateAdjuster {
- protected int targetBitrateBps = 0;
- protected int targetFps = 0;
+ protected int targetBitrateBps;
+ protected int targetFps;
@Override
public void setTargets(int targetBitrateBps, int targetFps) {
diff --git a/sdk/android/src/java/org/webrtc/Camera1Session.java b/sdk/android/src/java/org/webrtc/Camera1Session.java
index e4c68c4..ad2b9bf 100644
--- a/sdk/android/src/java/org/webrtc/Camera1Session.java
+++ b/sdk/android/src/java/org/webrtc/Camera1Session.java
@@ -49,7 +49,7 @@
private final long constructionTimeNs; // Construction time of this class.
private SessionState state;
- private boolean firstFrameReported = false;
+ private boolean firstFrameReported;
// TODO(titovartem) make correct fix during webrtc:9175
@SuppressWarnings("ByteBufferBackingArray")
diff --git a/sdk/android/src/java/org/webrtc/Camera2Session.java b/sdk/android/src/java/org/webrtc/Camera2Session.java
index fd34ce7..717c23d 100644
--- a/sdk/android/src/java/org/webrtc/Camera2Session.java
+++ b/sdk/android/src/java/org/webrtc/Camera2Session.java
@@ -71,7 +71,7 @@
// State
private SessionState state = SessionState.RUNNING;
- private boolean firstFrameReported = false;
+ private boolean firstFrameReported;
// Used only for stats. Only used on the camera thread.
private final long constructionTimeNs; // Construction time of this class.
diff --git a/sdk/android/src/java/org/webrtc/DynamicBitrateAdjuster.java b/sdk/android/src/java/org/webrtc/DynamicBitrateAdjuster.java
index 1f970bb..7863e66 100644
--- a/sdk/android/src/java/org/webrtc/DynamicBitrateAdjuster.java
+++ b/sdk/android/src/java/org/webrtc/DynamicBitrateAdjuster.java
@@ -26,9 +26,9 @@
private static final double BITS_PER_BYTE = 8.0;
// How far the codec has deviated above (or below) the target bitrate (tracked in bytes).
- private double deviationBytes = 0;
- private double timeSinceLastAdjustmentMs = 0;
- private int bitrateAdjustmentScaleExp = 0;
+ private double deviationBytes;
+ private double timeSinceLastAdjustmentMs;
+ private int bitrateAdjustmentScaleExp;
@Override
public void setTargets(int targetBitrateBps, int targetFps) {
diff --git a/sdk/android/src/java/org/webrtc/HardwareVideoEncoder.java b/sdk/android/src/java/org/webrtc/HardwareVideoEncoder.java
index c5d6df7..0dd2101 100644
--- a/sdk/android/src/java/org/webrtc/HardwareVideoEncoder.java
+++ b/sdk/android/src/java/org/webrtc/HardwareVideoEncoder.java
@@ -104,15 +104,15 @@
// --- Only accessed on the output thread.
// Contents of the last observed config frame output by the MediaCodec. Used by H.264.
- @Nullable private ByteBuffer configBuffer = null;
+ @Nullable private ByteBuffer configBuffer;
private int adjustedBitrate;
// Whether the encoder is running. Volatile so that the output thread can watch this value and
// exit when the encoder stops.
- private volatile boolean running = false;
+ private volatile boolean running;
// Any exception thrown during shutdown. The output thread releases the MediaCodec and uses this
// value to send exceptions thrown during release back to the encoder thread.
- @Nullable private volatile Exception shutdownException = null;
+ @Nullable private volatile Exception shutdownException;
/**
* Creates a new HardwareVideoEncoder with the given codecName, codecType, colorFormat, key frame
diff --git a/sdk/android/src/java/org/webrtc/NativeLibrary.java b/sdk/android/src/java/org/webrtc/NativeLibrary.java
index 91ec4ca..7fa5d6f 100644
--- a/sdk/android/src/java/org/webrtc/NativeLibrary.java
+++ b/sdk/android/src/java/org/webrtc/NativeLibrary.java
@@ -28,7 +28,7 @@
}
private static Object lock = new Object();
- private static boolean libraryLoaded = false;
+ private static boolean libraryLoaded;
/**
* Loads the native library. Clients should call PeerConnectionFactory.initialize. It will call
diff --git a/sdk/android/src/java/org/webrtc/audio/WebRtcAudioEffects.java b/sdk/android/src/java/org/webrtc/audio/WebRtcAudioEffects.java
index 77aec83..116cf53 100644
--- a/sdk/android/src/java/org/webrtc/audio/WebRtcAudioEffects.java
+++ b/sdk/android/src/java/org/webrtc/audio/WebRtcAudioEffects.java
@@ -41,18 +41,18 @@
// Contains the available effect descriptors returned from the
// AudioEffect.getEffects() call. This result is cached to avoid doing the
// slow OS call multiple times.
- private static @Nullable Descriptor[] cachedEffects = null;
+ private static @Nullable Descriptor[] cachedEffects;
// Contains the audio effect objects. Created in enable() and destroyed
// in release().
- private @Nullable AcousticEchoCanceler aec = null;
- private @Nullable NoiseSuppressor ns = null;
+ private @Nullable AcousticEchoCanceler aec;
+ private @Nullable NoiseSuppressor ns;
// Affects the final state given to the setEnabled() method on each effect.
// The default state is set to "disabled" but each effect can also be enabled
// by calling setAEC() and setNS().
- private boolean shouldEnableAec = false;
- private boolean shouldEnableNs = false;
+ private boolean shouldEnableAec;
+ private boolean shouldEnableNs;
// Returns true if all conditions for supporting HW Acoustic Echo Cancellation (AEC) are
// fulfilled.
diff --git a/sdk/android/src/java/org/webrtc/audio/WebRtcAudioRecord.java b/sdk/android/src/java/org/webrtc/audio/WebRtcAudioRecord.java
index 66f619d..d2a1785 100644
--- a/sdk/android/src/java/org/webrtc/audio/WebRtcAudioRecord.java
+++ b/sdk/android/src/java/org/webrtc/audio/WebRtcAudioRecord.java
@@ -63,10 +63,10 @@
private @Nullable ByteBuffer byteBuffer;
- private @Nullable AudioRecord audioRecord = null;
- private @Nullable AudioRecordThread audioThread = null;
+ private @Nullable AudioRecord audioRecord;
+ private @Nullable AudioRecordThread audioThread;
- private volatile boolean microphoneMute = false;
+ private volatile boolean microphoneMute;
private byte[] emptyBytes;
private final @Nullable AudioRecordErrorCallback errorCallback;
diff --git a/sdk/android/src/java/org/webrtc/audio/WebRtcAudioTrack.java b/sdk/android/src/java/org/webrtc/audio/WebRtcAudioTrack.java
index f3a38f0..7912de7 100644
--- a/sdk/android/src/java/org/webrtc/audio/WebRtcAudioTrack.java
+++ b/sdk/android/src/java/org/webrtc/audio/WebRtcAudioTrack.java
@@ -21,11 +21,11 @@
import java.lang.Thread;
import java.nio.ByteBuffer;
import javax.annotation.Nullable;
+import org.webrtc.CalledByNative;
import org.webrtc.Logging;
import org.webrtc.ThreadUtils;
import org.webrtc.audio.JavaAudioDeviceModule.AudioTrackErrorCallback;
import org.webrtc.audio.JavaAudioDeviceModule.AudioTrackStartErrorCode;
-import org.webrtc.CalledByNative;
class WebRtcAudioTrack {
private static final String TAG = "WebRtcAudioTrackExternal";
@@ -69,13 +69,13 @@
private ByteBuffer byteBuffer;
- private @Nullable AudioTrack audioTrack = null;
- private @Nullable AudioTrackThread audioThread = null;
+ private @Nullable AudioTrack audioTrack;
+ private @Nullable AudioTrackThread audioThread;
private final VolumeLogger volumeLogger;
// Samples to be played are replaced by zeros if |speakerMute| is set to true.
// Can be used to ensure that the speaker is fully muted.
- private volatile boolean speakerMute = false;
+ private volatile boolean speakerMute;
private byte[] emptyBytes;
private final @Nullable AudioTrackErrorCallback errorCallback;