diff --git a/android/app/src/main/java/org/jitsi/meet/audiomode/AudioModeModule.java b/android/app/src/main/java/org/jitsi/meet/audiomode/AudioModeModule.java index 09fa9f866..c2bde519d 100644 --- a/android/app/src/main/java/org/jitsi/meet/audiomode/AudioModeModule.java +++ b/android/app/src/main/java/org/jitsi/meet/audiomode/AudioModeModule.java @@ -19,7 +19,6 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import java.util.HashMap; -import java.util.List; import java.util.Map; /** @@ -55,7 +54,7 @@ public class AudioModeModule extends ReactContextBaseJavaModule { * */ private static final String ACTION_HEADSET_PLUG - = (android.os.Build.VERSION.SDK_INT >= 21) + = (Build.VERSION.SDK_INT >= 21) ? AudioManager.ACTION_HEADSET_PLUG : Intent.ACTION_HEADSET_PLUG; diff --git a/android/app/src/main/java/org/jitsi/meet/audiomode/BluetoothHeadsetMonitor.java b/android/app/src/main/java/org/jitsi/meet/audiomode/BluetoothHeadsetMonitor.java index 099f6d1a9..ab0108277 100644 --- a/android/app/src/main/java/org/jitsi/meet/audiomode/BluetoothHeadsetMonitor.java +++ b/android/app/src/main/java/org/jitsi/meet/audiomode/BluetoothHeadsetMonitor.java @@ -15,8 +15,6 @@ import android.util.Log; import com.facebook.react.bridge.ReactContext; -import java.util.List; - /** * Helper class to detect and handle Bluetooth device changes. It monitors * Bluetooth headsets being connected / disconnected and notifies the module @@ -81,9 +79,6 @@ public class BluetoothHeadsetMonitor { audioManager = (AudioManager) reactContext.getSystemService(Context.AUDIO_SERVICE); - bluetoothAdapter = null; - bluetoothHeadset = null; - bluetoothProfileListener = null; mainThreadHandler = new Handler(Looper.getMainLooper()); } @@ -106,9 +101,8 @@ public class BluetoothHeadsetMonitor { if (bluetoothHeadset == null) { headsetAvailable = false; } else { - List devices - = bluetoothHeadset.getConnectedDevices(); - headsetAvailable = !devices.isEmpty(); + headsetAvailable + = !bluetoothHeadset.getConnectedDevices().isEmpty(); } audioModeModule.onAudioDeviceChange(); }