voice-react-native-sdk 2.0.0-preview.fork.6 → 2.0.0-preview.fork.8
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.
|
@@ -35,7 +35,11 @@ class MediaPlayerManager {
|
|
|
35
35
|
soundMap.put(SoundTable.RINGTONE, soundPool.load(context, R.raw.ringtone, 1));
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
public void play(final SoundTable sound) {
|
|
38
|
+
public synchronized void play(final SoundTable sound) {
|
|
39
|
+
if (activeStream != 0) {
|
|
40
|
+
soundPool.stop(activeStream);
|
|
41
|
+
activeStream = 0;
|
|
42
|
+
}
|
|
39
43
|
activeStream = soundPool.play(
|
|
40
44
|
soundMap.get(sound),
|
|
41
45
|
1.f,
|
|
@@ -45,7 +49,7 @@ class MediaPlayerManager {
|
|
|
45
49
|
1.f);
|
|
46
50
|
}
|
|
47
51
|
|
|
48
|
-
public void stop() {
|
|
52
|
+
public synchronized void stop() {
|
|
49
53
|
soundPool.stop(activeStream);
|
|
50
54
|
activeStream = 0;
|
|
51
55
|
}
|
|
@@ -34,10 +34,13 @@ public class VoiceActivityProxy {
|
|
|
34
34
|
}
|
|
35
35
|
public void onCreate(Bundle ignoredSavedInstanceState) {
|
|
36
36
|
logger.debug("onCreate(): invoked");
|
|
37
|
-
|
|
37
|
+
|
|
38
|
+
/* April 3, 2026 - Commenting out the permission check since we are doing permission management in the expo app.
|
|
38
39
|
if (!checkPermissions()) {
|
|
39
40
|
requestPermissions();
|
|
40
41
|
}
|
|
42
|
+
*/
|
|
43
|
+
|
|
41
44
|
// These flags ensure that the activity can be launched when the screen is locked.
|
|
42
45
|
Window window = context.getWindow();
|
|
43
46
|
window.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
|
|
@@ -28,6 +28,14 @@ public class VoiceFirebaseMessagingService extends FirebaseMessagingService {
|
|
|
28
28
|
public void onCallInvite(@NonNull CallInvite callInvite) {
|
|
29
29
|
logger.log(String.format("onCallInvite %s", callInvite.getCallSid()));
|
|
30
30
|
|
|
31
|
+
// FCM is at-least-once; drop duplicate deliveries for the same callSid so we
|
|
32
|
+
// don't spawn a second notification/ringer that can orphan a looping sound stream.
|
|
33
|
+
if (null != getCallRecordDatabase().get(new CallRecord(callInvite.getCallSid()))) {
|
|
34
|
+
logger.warning(String.format(
|
|
35
|
+
"Duplicate call invite ignored for callSid %s", callInvite.getCallSid()));
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
31
39
|
final CallRecord callRecord = new CallRecord(UUID.randomUUID(), callInvite);
|
|
32
40
|
|
|
33
41
|
getCallRecordDatabase().add(callRecord);
|