Explorar el Código

android: make sure all AudioMode operations run in the audio thread

master
Saúl Ibarra Corretgé hace 5 años
padre
commit
05a8591110

+ 14
- 4
android/sdk/src/main/java/org/jitsi/meet/sdk/AudioModeModule.java Ver fichero

198
      */
198
      */
199
     @Override
199
     @Override
200
     public void initialize() {
200
     public void initialize() {
201
-        setAudioDeviceHandler();
201
+        runInAudioThread(new Runnable() {
202
+            @Override
203
+            public void run() {
204
+                setAudioDeviceHandler();
205
+            }
206
+        });
202
     }
207
     }
203
 
208
 
204
     private void setAudioDeviceHandler() {
209
     private void setAudioDeviceHandler() {
292
      * @param use Boolean indicator of where it should be used or not.
297
      * @param use Boolean indicator of where it should be used or not.
293
      */
298
      */
294
     @ReactMethod
299
     @ReactMethod
295
-    public void setUseConnectionService(boolean use) {
296
-        useConnectionService_ = use;
297
-        setAudioDeviceHandler();
300
+    public void setUseConnectionService(final boolean use) {
301
+        runInAudioThread(new Runnable() {
302
+            @Override
303
+            public void run() {
304
+                useConnectionService_ = use;
305
+                setAudioDeviceHandler();
306
+            }
307
+        });
298
     }
308
     }
299
 
309
 
300
     /**
310
     /**

Loading…
Cancelar
Guardar