From db01a303debf399c83104dcdc6918e3bb95efd78 Mon Sep 17 00:00:00 2001 From: Ergyun Syuleyman Date: Mon, 15 Jun 2020 17:54:48 +0300 Subject: [PATCH] NY-10604: [AN]: Android 10 is vibrating after accept call on call escalation NY-10689: [AN]: Android doesn't stops rings if caller ends call if the app is killed and device is not locked --- .../communicator/data/sdk/calls/ConferenceSDKModule.java | 5 +++++ .../mobile/communicator/utils/NotificationHelper.java | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/app/src/main/java/com/nynja/mobile/communicator/data/sdk/calls/ConferenceSDKModule.java b/app/src/main/java/com/nynja/mobile/communicator/data/sdk/calls/ConferenceSDKModule.java index 2f839275ce..65b8cf5d94 100644 --- a/app/src/main/java/com/nynja/mobile/communicator/data/sdk/calls/ConferenceSDKModule.java +++ b/app/src/main/java/com/nynja/mobile/communicator/data/sdk/calls/ConferenceSDKModule.java @@ -1538,6 +1538,7 @@ public class ConferenceSDKModule extends BaseSDKModule { @Override public void receivedStopRinging(String conferenceId) { + Timber.d("receivedStopRinging(): callId=" + conferenceId); onStopConferenceRinging(conferenceId); } @@ -1601,6 +1602,7 @@ public class ConferenceSDKModule extends BaseSDKModule { public void receivedCompletedCall(NYNCall call) { if (call == null) return; String callId = call.callId(); + Timber.d("receivedCompletedCall(): callId=" + callId); onCallEndedHandle(call, callId, true); if (callId != null && hasCreatedActiveCall() && mActiveConference.mConference != null @@ -3161,6 +3163,7 @@ public class ConferenceSDKModule extends BaseSDKModule { leaveVoiceMessage(contactPhoneId); } } else { + mNotificationHelper.clearCallPush(ActiveConferenceCall.ANDROID_10_PUSH_CALL_NTFN_ID); onConferenceEnded(conferenceId); } } @@ -3205,10 +3208,12 @@ public class ConferenceSDKModule extends BaseSDKModule { mActiveConference.mConference != null && mActiveConference.mConference.callId().contentEquals(conferenceId)) { mActiveConference.isRinging = false; + stopRinging(); if (mActiveConference.mConference.isOutgoing() && mActiveConference.isOutgoingCall) { // Nothing to do when is my outgoing call - may need check when allow multiple login } else { + mNotificationHelper.clearCallPush(ActiveConferenceCall.ANDROID_10_PUSH_CALL_NTFN_ID); //if (isP2P() && !mActiveConference.isCallRinging()) return; onConferenceEnded(conferenceId); } diff --git a/app/src/main/java/com/nynja/mobile/communicator/utils/NotificationHelper.java b/app/src/main/java/com/nynja/mobile/communicator/utils/NotificationHelper.java index f1e1b5c342..2137a16297 100644 --- a/app/src/main/java/com/nynja/mobile/communicator/utils/NotificationHelper.java +++ b/app/src/main/java/com/nynja/mobile/communicator/utils/NotificationHelper.java @@ -311,6 +311,7 @@ public class NotificationHelper extends ContextWrapper { settingNotifications.isSound(), settingNotifications.isInAppVibrate(), notificationSoundUri); channel.setShowBadge(false); + channel.setLockscreenVisibility(NotificationCompat.VISIBILITY_PUBLIC); Timber.d("buildRingingChannel(): new channel: channel id=%s, sound=%s", id, notificationSoundUri.toString()); getManager().createNotificationChannel(channel); @@ -717,6 +718,13 @@ public class NotificationHelper extends ContextWrapper { String callId = notification.extras.getString(MainActivity.INTENT_NOTIFICATION_CALL_ID); if (StringUtils.isNotEmpty(callId) && notification.extras.getBoolean(MainActivity.INTENT_FROM_CALL_NOTIFICATION, false)) { + + ////////////////////////////////////////////////////////////////////////// + // Workaround fix: stop vibrating and notifications in some devices and OS versions on cancel + notification.flags &= Notification.FLAG_INSISTENT; + sendRingingNotify(notification, ActiveConferenceCall.ANDROID_10_PUSH_CALL_NTFN_ID); + ////////////////////////////////////////////////////////////////////////// + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { getManager().cancel(getString(R.string.app_name), notificationId); } else { -- GitLab