voice-react-native-sdk 2.0.0-preview.fork.4 → 2.0.0-preview.fork.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -54,11 +54,14 @@ class CallListenerProxy implements Call.Listener {
54
54
 
55
55
  // stop sound and routing
56
56
  getMediaPlayerManager().stop();
57
- getAudioSwitchManager().getAudioSwitch().deactivate();
58
57
 
59
58
  // find call record & remove
60
59
  CallRecord callRecord = Objects.requireNonNull(getCallRecordDatabase().remove(new CallRecord(uuid)));
61
60
 
61
+ if (getCallRecordDatabase().getCollection().isEmpty()) {
62
+ getAudioSwitchManager().getAudioSwitch().deactivate();
63
+ }
64
+
62
65
  // take down notification
63
66
  getVoiceServiceApi().cancelActiveCallNotification(callRecord);
64
67
 
@@ -147,7 +150,9 @@ class CallListenerProxy implements Call.Listener {
147
150
  // stop audio & cancel notification
148
151
  getMediaPlayerManager().stop();
149
152
  getMediaPlayerManager().play(MediaPlayerManager.SoundTable.DISCONNECT);
150
- getAudioSwitchManager().getAudioSwitch().deactivate();
153
+ if (getCallRecordDatabase().getCollection().isEmpty()) {
154
+ getAudioSwitchManager().getAudioSwitch().deactivate();
155
+ }
151
156
  getVoiceServiceApi().cancelActiveCallNotification(callRecord);
152
157
 
153
158
  // notify JS layer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "voice-react-native-sdk",
3
- "version": "2.0.0-preview.fork.4",
3
+ "version": "2.0.0-preview.fork.5",
4
4
  "description": "Twilio Voice React Native SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",