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
     /**
158
     /**
159
      * Whether or not the ConnectionService is used for selecting audio devices.
159
      * Whether or not the ConnectionService is used for selecting audio devices.
160
      */
160
      */
161
-    private static boolean useConnectionService() {
161
+    static boolean useConnectionService() {
162
         return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O;
162
         return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O;
163
     }
163
     }
164
 
164
 
295
             = (AudioManager)
295
             = (AudioManager)
296
                 reactContext.getSystemService(Context.AUDIO_SERVICE);
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
         // detect the available devices.
299
         // detect the available devices.
300
-        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
300
+        if (!useConnectionService()) {
301
             // Setup runtime device change detection.
301
             // Setup runtime device change detection.
302
             setupAudioRouteChangeDetection();
302
             setupAudioRouteChangeDetection();
303
 
303
 

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

60
                 new org.jitsi.meet.sdk.dropbox.Dropbox(reactContext),
60
                 new org.jitsi.meet.sdk.dropbox.Dropbox(reactContext),
61
                 new org.jitsi.meet.sdk.net.NAT64AddrInfoModule(reactContext)));
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
             nativeModules.add(new RNConnectionService(reactContext));
64
             nativeModules.add(new RNConnectionService(reactContext));
66
         }
65
         }
67
 
66
 

Loading…
Cancel
Save