|
@@ -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
|
);
|