Remove unnecessary source code
This commit is contained in:
parent
ef39baab47
commit
bab94a207d
|
@ -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;
|
||||
|
||||
|
|
|
@ -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<BluetoothDevice> devices
|
||||
= bluetoothHeadset.getConnectedDevices();
|
||||
headsetAvailable = !devices.isEmpty();
|
||||
headsetAvailable
|
||||
= !bluetoothHeadset.getConnectedDevices().isEmpty();
|
||||
}
|
||||
audioModeModule.onAudioDeviceChange();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue