diff --git a/android/sdk/src/main/java/org/jitsi/meet/sdk/AudioModeModule.java b/android/sdk/src/main/java/org/jitsi/meet/sdk/AudioModeModule.java index fc064658c..e1af0a779 100644 --- a/android/sdk/src/main/java/org/jitsi/meet/sdk/AudioModeModule.java +++ b/android/sdk/src/main/java/org/jitsi/meet/sdk/AudioModeModule.java @@ -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(); diff --git a/android/sdk/src/main/java/org/jitsi/meet/sdk/ReactInstanceManagerHolder.java b/android/sdk/src/main/java/org/jitsi/meet/sdk/ReactInstanceManagerHolder.java index db4f9f966..44ded0da1 100644 --- a/android/sdk/src/main/java/org/jitsi/meet/sdk/ReactInstanceManagerHolder.java +++ b/android/sdk/src/main/java/org/jitsi/meet/sdk/ReactInstanceManagerHolder.java @@ -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)); }