Browse Source

ref(AudioModeModule): check 1 method to enable ConnectionService

j8
paweldomas 6 years ago
parent
commit
6d0b6bee85

+ 3
- 3
android/sdk/src/main/java/org/jitsi/meet/sdk/AudioModeModule.java View File

@@ -158,7 +158,7 @@ class AudioModeModule extends ReactContextBaseJavaModule
158 158
     /**
159 159
      * Whether or not the ConnectionService is used for selecting audio devices.
160 160
      */
161
-    private static boolean useConnectionService() {
161
+    static boolean useConnectionService() {
162 162
         return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O;
163 163
     }
164 164
 
@@ -295,9 +295,9 @@ class AudioModeModule extends ReactContextBaseJavaModule
295 295
             = (AudioManager)
296 296
                 reactContext.getSystemService(Context.AUDIO_SERVICE);
297 297
 
298
-        // Starting Oreo the ConnectionImpl from ConnectionService us used to
298
+        // Starting Oreo the ConnectionImpl from ConnectionService is used to
299 299
         // detect the available devices.
300
-        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
300
+        if (!useConnectionService()) {
301 301
             // Setup runtime device change detection.
302 302
             setupAudioRouteChangeDetection();
303 303
 

+ 1
- 2
android/sdk/src/main/java/org/jitsi/meet/sdk/ReactInstanceManagerHolder.java View File

@@ -60,8 +60,7 @@ class ReactInstanceManagerHolder {
60 60
                 new org.jitsi.meet.sdk.dropbox.Dropbox(reactContext),
61 61
                 new org.jitsi.meet.sdk.net.NAT64AddrInfoModule(reactContext)));
62 62
 
63
-        if (android.os.Build.VERSION.SDK_INT
64
-                >= android.os.Build.VERSION_CODES.O) {
63
+        if (AudioModeModule.useConnectionService()) {
65 64
             nativeModules.add(new RNConnectionService(reactContext));
66 65
         }
67 66
 

Loading…
Cancel
Save