voice-react-native-sdk 1.6.2-fork.23-hack → 1.6.2-fork.24-hack
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.
- package/android/build.gradle +1 -1
- package/android/src/main/AndroidManifest.xml +1 -2
- package/android/src/main/java/com/twiliovoicereactnative/CallListenerProxy.java +5 -1
- package/android/src/main/java/com/twiliovoicereactnative/NotificationUtility.java +13 -26
- package/android/src/main/java/com/twiliovoicereactnative/TwilioVoiceReactNativeModule.java +3 -0
- package/android/src/main/res/values/config.xml +2 -2
- package/package.json +1 -1
package/android/build.gradle
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
|
|
5
5
|
<uses-permission android:name="android.permission.INTERNET" />
|
|
6
6
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
|
7
|
-
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
|
|
8
7
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
|
9
8
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
|
10
9
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE"/>
|
|
@@ -16,7 +15,7 @@
|
|
|
16
15
|
<service
|
|
17
16
|
android:name=".VoiceFirebaseMessagingService"
|
|
18
17
|
android:stopWithTask="false"
|
|
19
|
-
android:exported="
|
|
18
|
+
android:exported="false"
|
|
20
19
|
android:enabled="@bool/twiliovoicereactnative_firebasemessagingservice_enabled">
|
|
21
20
|
<intent-filter>
|
|
22
21
|
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
|
@@ -57,7 +57,11 @@ class CallListenerProxy implements Call.Listener {
|
|
|
57
57
|
getAudioSwitchManager().getAudioSwitch().deactivate();
|
|
58
58
|
|
|
59
59
|
// find call record & remove
|
|
60
|
-
CallRecord callRecord = Objects.requireNonNull(getCallRecordDatabase().remove(new CallRecord(uuid)));
|
|
60
|
+
//CallRecord callRecord = Objects.requireNonNull(getCallRecordDatabase().remove(new CallRecord(uuid)));
|
|
61
|
+
CallRecord callRecord = getCallRecordDatabase().remove(new CallRecord(uuid));
|
|
62
|
+
if (callRecord == null) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
61
65
|
|
|
62
66
|
// take down notification
|
|
63
67
|
getVoiceServiceApi().cancelActiveCallNotification(callRecord);
|
|
@@ -24,7 +24,6 @@ import androidx.core.app.Person;
|
|
|
24
24
|
|
|
25
25
|
import com.twilio.voice.CallInvite;
|
|
26
26
|
|
|
27
|
-
import static com.twiliovoicereactnative.ConfigurationProperties.isFullScreenNotificationEnabled;
|
|
28
27
|
import static com.twiliovoicereactnative.Constants.VOICE_CHANNEL_DEFAULT_IMPORTANCE;
|
|
29
28
|
import static com.twiliovoicereactnative.Constants.VOICE_CHANNEL_HIGH_IMPORTANCE;
|
|
30
29
|
import static com.twiliovoicereactnative.Constants.VOICE_CHANNEL_LOW_IMPORTANCE;
|
|
@@ -166,19 +165,16 @@ class NotificationUtility {
|
|
|
166
165
|
callRecord.getUuid());
|
|
167
166
|
PendingIntent piAcceptIntent = constructPendingIntentForActivity(context, acceptIntent);
|
|
168
167
|
|
|
169
|
-
|
|
168
|
+
return constructNotificationBuilder(context, channelImportance)
|
|
170
169
|
.setSmallIcon(notificationResource.getSmallIconId())
|
|
171
170
|
.setCategory(Notification.CATEGORY_CALL)
|
|
172
171
|
.setAutoCancel(true)
|
|
173
172
|
.setContentIntent(piForegroundIntent)
|
|
173
|
+
.setFullScreenIntent(piForegroundIntent, true)
|
|
174
174
|
.addPerson(incomingCaller)
|
|
175
175
|
.setStyle(NotificationCompat.CallStyle.forIncomingCall(
|
|
176
|
-
incomingCaller, piRejectIntent, piAcceptIntent))
|
|
177
|
-
|
|
178
|
-
// CallStyle.forIncomingCall() already provides the system call UI with answer/reject buttons
|
|
179
|
-
// that work properly even when the phone is locked. Setting a full screen intent interferes
|
|
180
|
-
// with the system call UI, preventing the answer/reject buttons from appearing.
|
|
181
|
-
return builder.build();
|
|
176
|
+
incomingCaller, piRejectIntent, piAcceptIntent))
|
|
177
|
+
.build();
|
|
182
178
|
}
|
|
183
179
|
|
|
184
180
|
public static Notification createCallAnsweredNotificationWithLowImportance(@NonNull Context context,
|
|
@@ -206,18 +202,16 @@ class NotificationUtility {
|
|
|
206
202
|
callRecord.getUuid());
|
|
207
203
|
PendingIntent piEndCallIntent = constructPendingIntentForService(context, endCallIntent);
|
|
208
204
|
|
|
209
|
-
|
|
205
|
+
return constructNotificationBuilder(context, Constants.VOICE_CHANNEL_LOW_IMPORTANCE)
|
|
210
206
|
.setSmallIcon(notificationResource.getSmallIconId())
|
|
211
207
|
.setCategory(Notification.CATEGORY_CALL)
|
|
212
208
|
.setAutoCancel(false)
|
|
213
209
|
.setContentIntent(piForegroundIntent)
|
|
210
|
+
.setFullScreenIntent(piForegroundIntent, true)
|
|
214
211
|
.setOngoing(true)
|
|
215
212
|
.addPerson(activeCaller)
|
|
216
|
-
.setStyle(NotificationCompat.CallStyle.forOngoingCall(activeCaller, piEndCallIntent))
|
|
217
|
-
|
|
218
|
-
// CallStyle.forOngoingCall() provides the system call UI that works properly even when the phone is locked.
|
|
219
|
-
// Setting a full screen intent interferes with the system call UI.
|
|
220
|
-
return builder.build();
|
|
213
|
+
.setStyle(NotificationCompat.CallStyle.forOngoingCall(activeCaller, piEndCallIntent))
|
|
214
|
+
.build();
|
|
221
215
|
}
|
|
222
216
|
|
|
223
217
|
public static Notification createOutgoingCallNotificationWithLowImportance(@NonNull Context context,
|
|
@@ -245,18 +239,16 @@ class NotificationUtility {
|
|
|
245
239
|
callRecord.getUuid());
|
|
246
240
|
PendingIntent piEndCallIntent = constructPendingIntentForService(context, endCallIntent);
|
|
247
241
|
|
|
248
|
-
|
|
242
|
+
return constructNotificationBuilder(context, Constants.VOICE_CHANNEL_LOW_IMPORTANCE)
|
|
249
243
|
.setSmallIcon(notificationResource.getSmallIconId())
|
|
250
244
|
.setCategory(Notification.CATEGORY_CALL)
|
|
251
245
|
.setAutoCancel(false)
|
|
252
246
|
.setContentIntent(piForegroundIntent)
|
|
247
|
+
.setFullScreenIntent(piForegroundIntent, true)
|
|
253
248
|
.setOngoing(true)
|
|
254
249
|
.addPerson(activeCaller)
|
|
255
|
-
.setStyle(NotificationCompat.CallStyle.forOngoingCall(activeCaller, piEndCallIntent))
|
|
256
|
-
|
|
257
|
-
// CallStyle.forOngoingCall() provides the system call UI that works properly even when the phone is locked.
|
|
258
|
-
// Setting a full screen intent interferes with the system call UI.
|
|
259
|
-
return builder.build();
|
|
250
|
+
.setStyle(NotificationCompat.CallStyle.forOngoingCall(activeCaller, piEndCallIntent))
|
|
251
|
+
.build();
|
|
260
252
|
}
|
|
261
253
|
|
|
262
254
|
public static void createNotificationChannels(@NonNull Context context) {
|
|
@@ -280,11 +272,6 @@ class NotificationUtility {
|
|
|
280
272
|
notificationManager.deleteNotificationChannelGroup(Constants.VOICE_CHANNEL_GROUP);
|
|
281
273
|
}
|
|
282
274
|
|
|
283
|
-
public static boolean isFullscreenIntentEnabled(Context context) {
|
|
284
|
-
return isFullScreenNotificationEnabled(context) &&
|
|
285
|
-
NotificationManagerCompat.from(context).canUseFullScreenIntent();
|
|
286
|
-
}
|
|
287
|
-
|
|
288
275
|
private static NotificationChannelCompat createNotificationChannel(@NonNull Context context,
|
|
289
276
|
@NonNull final String voiceChannelId) {
|
|
290
277
|
final int notificationImportance = getChannelImportance(voiceChannelId);
|
|
@@ -361,4 +348,4 @@ class NotificationUtility {
|
|
|
361
348
|
.appendPath(String.valueOf(id))
|
|
362
349
|
).build();
|
|
363
350
|
}
|
|
364
|
-
}
|
|
351
|
+
}
|
|
@@ -646,6 +646,8 @@ public class TwilioVoiceReactNativeModule extends ReactContextBaseJavaModule {
|
|
|
646
646
|
|
|
647
647
|
@ReactMethod
|
|
648
648
|
public void system_requestFullScreenNotificationPermission(Promise promise) {
|
|
649
|
+
promise.resolve(null);
|
|
650
|
+
/*
|
|
649
651
|
final boolean shouldStartActivity =
|
|
650
652
|
Build.VERSION.SDK_INT > Build.VERSION_CODES.TIRAMISU &&
|
|
651
653
|
isFullScreenNotificationEnabled(reactContext);
|
|
@@ -663,6 +665,7 @@ public class TwilioVoiceReactNativeModule extends ReactContextBaseJavaModule {
|
|
|
663
665
|
}
|
|
664
666
|
|
|
665
667
|
promise.resolve(null);
|
|
668
|
+
*/
|
|
666
669
|
}
|
|
667
670
|
|
|
668
671
|
@Override
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
2
2
|
<resources>
|
|
3
|
-
<bool name="twiliovoicereactnative_firebasemessagingservice_enabled">
|
|
4
|
-
<bool name="twiliovoicereactnative_fullscreennotification_enabled">
|
|
3
|
+
<bool name="twiliovoicereactnative_firebasemessagingservice_enabled">false</bool>
|
|
4
|
+
<bool name="twiliovoicereactnative_fullscreennotification_enabled">false</bool>
|
|
5
5
|
</resources>
|