ref(AudioModeModule): check 1 method to enable ConnectionService
This commit is contained in:
parent
ac02a17943
commit
6d0b6bee85
|
@ -158,7 +158,7 @@ class AudioModeModule extends ReactContextBaseJavaModule
|
|||
/**
|
||||
* Whether or not the ConnectionService is used for selecting audio devices.
|
||||
*/
|
||||
private static boolean useConnectionService() {
|
||||
static boolean useConnectionService() {
|
||||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O;
|
||||
}
|
||||
|
||||
|
@ -295,9 +295,9 @@ class AudioModeModule extends ReactContextBaseJavaModule
|
|||
= (AudioManager)
|
||||
reactContext.getSystemService(Context.AUDIO_SERVICE);
|
||||
|
||||
// Starting Oreo the ConnectionImpl from ConnectionService us used to
|
||||
// Starting Oreo the ConnectionImpl from ConnectionService is used to
|
||||
// detect the available devices.
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
||||
if (!useConnectionService()) {
|
||||
// Setup runtime device change detection.
|
||||
setupAudioRouteChangeDetection();
|
||||
|
||||
|
|
|
@ -60,8 +60,7 @@ class ReactInstanceManagerHolder {
|
|||
new org.jitsi.meet.sdk.dropbox.Dropbox(reactContext),
|
||||
new org.jitsi.meet.sdk.net.NAT64AddrInfoModule(reactContext)));
|
||||
|
||||
if (android.os.Build.VERSION.SDK_INT
|
||||
>= android.os.Build.VERSION_CODES.O) {
|
||||
if (AudioModeModule.useConnectionService()) {
|
||||
nativeModules.add(new RNConnectionService(reactContext));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue