Sfoglia il codice sorgente

proximity: enable the proximity sensor when the device is set to earpiece

j8
Saúl Ibarra Corretgé 5 anni fa
parent
commit
6616f728f6
1 ha cambiato i file con 4 aggiunte e 3 eliminazioni
  1. 4
    3
      react/features/mobile/proximity/middleware.js

+ 4
- 3
react/features/mobile/proximity/middleware.js Vedi File

@@ -7,14 +7,15 @@ import { StateListenerRegistry } from '../../base/redux';
7 7
  * State listener which enables / disables the proximity sensor based on the
8 8
  * current conference state. If the proximity sensor is enabled, it will dim
9 9
  * the screen and disable touch controls when an object is nearby. The
10
- * functionality is  enabled when a conference is in audio-only mode.
10
+ * functionality is  enabled when the current audio device is the earpiece.
11 11
  */
12 12
 StateListenerRegistry.register(
13 13
     /* selector */ state => {
14
-        const { enabled: audioOnly } = state['features/base/audio-only'];
14
+        const { devices } = state['features/mobile/audio-mode'];
15
+        const selectedDevice = devices.filter(d => d.selected)[0];
15 16
         const conference = getCurrentConference(state);
16 17
 
17
-        return Boolean(conference && audioOnly);
18
+        return Boolean(conference && selectedDevice?.type === 'EARPIECE');
18 19
     },
19 20
     /* listener */ proximityEnabled => _setProximityEnabled(proximityEnabled)
20 21
 );

Loading…
Annulla
Salva