voice-react-native-sdk 1.6.2-fork.30 → 1.6.2-fork.40
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.
|
@@ -103,36 +103,41 @@ public class VoiceService extends Service {
|
|
|
103
103
|
// apparently the system can recreate the service without sending it an intent so protect
|
|
104
104
|
// against that case (GH-430).
|
|
105
105
|
if (null != intent) {
|
|
106
|
+
final CallRecordDatabase.CallRecord callRecord = getCallRecordDatabase().get(new CallRecordDatabase.CallRecord(Objects.requireNonNull(getMessageUUID(intent))));
|
|
107
|
+
if (null == callRecord) {
|
|
108
|
+
logger.warning("No call record found");
|
|
109
|
+
return START_NOT_STICKY;
|
|
110
|
+
}
|
|
106
111
|
switch (Objects.requireNonNull(intent.getAction())) {
|
|
107
112
|
case ACTION_INCOMING_CALL:
|
|
108
|
-
incomingCall(
|
|
113
|
+
incomingCall(callRecord);
|
|
109
114
|
break;
|
|
110
115
|
case ACTION_ACCEPT_CALL:
|
|
111
116
|
try {
|
|
112
|
-
acceptCall(
|
|
117
|
+
acceptCall(callRecord);
|
|
113
118
|
} catch (SecurityException e) {
|
|
114
119
|
sendPermissionsError();
|
|
115
120
|
logger.warning(e, "Cannot accept call, lacking necessary permissions");
|
|
116
121
|
}
|
|
117
122
|
break;
|
|
118
123
|
case ACTION_REJECT_CALL:
|
|
119
|
-
rejectCall(
|
|
124
|
+
rejectCall(callRecord);
|
|
120
125
|
break;
|
|
121
126
|
case ACTION_CANCEL_CALL:
|
|
122
|
-
cancelCall(
|
|
127
|
+
cancelCall(callRecord);
|
|
123
128
|
break;
|
|
124
129
|
case ACTION_CALL_DISCONNECT:
|
|
125
|
-
disconnect(
|
|
130
|
+
disconnect(callRecord);
|
|
126
131
|
break;
|
|
127
132
|
case ACTION_RAISE_OUTGOING_CALL_NOTIFICATION:
|
|
128
|
-
raiseOutgoingCallNotification(
|
|
133
|
+
raiseOutgoingCallNotification(callRecord);
|
|
129
134
|
break;
|
|
130
135
|
case ACTION_CANCEL_ACTIVE_CALL_NOTIFICATION:
|
|
131
|
-
cancelActiveCallNotification(
|
|
136
|
+
cancelActiveCallNotification(callRecord);
|
|
132
137
|
break;
|
|
133
138
|
case ACTION_FOREGROUND_AND_DEPRIORITIZE_INCOMING_CALL_NOTIFICATION:
|
|
134
139
|
foregroundAndDeprioritizeIncomingCallNotification(
|
|
135
|
-
|
|
140
|
+
callRecord);
|
|
136
141
|
break;
|
|
137
142
|
case ACTION_PUSH_APP_TO_FOREGROUND:
|
|
138
143
|
logger.warning("VoiceService received foreground request, ignoring");
|
|
@@ -387,9 +392,11 @@ public class VoiceService extends Service {
|
|
|
387
392
|
private static UUID getMessageUUID(@NonNull final Intent intent) {
|
|
388
393
|
return (UUID)intent.getSerializableExtra(Constants.MSG_KEY_UUID);
|
|
389
394
|
}
|
|
395
|
+
/*
|
|
390
396
|
private static CallRecordDatabase.CallRecord getCallRecord(final UUID uuid) {
|
|
391
397
|
return Objects.requireNonNull(getCallRecordDatabase().get(new CallRecordDatabase.CallRecord(uuid)));
|
|
392
398
|
}
|
|
399
|
+
*/
|
|
393
400
|
private static void sendJSEvent(@NonNull String scope, @NonNull WritableMap event) {
|
|
394
401
|
getJSEventEmitter().sendEvent(scope, event);
|
|
395
402
|
}
|