Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Push notification on top of calling UI shown (WPB-11632) #3592

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

ohassine
Copy link
Member

@ohassine ohassine commented Nov 6, 2024

BugWPB-11632 [Android] Push notification on top of calling UI shown


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

When user receives a call, open the incoming call screen, the headsup notification stays visible

Causes (Optional)

We are not dismissing it.

Solutions

Dismissing the notification when the user the app can cause an other problem: there is no way to repopen incoming screen again, if the user finished the app

S, I changed the behavior a bit:

  • Now there is an answer button instead of open call button, it's predefined style from Android which ensure that the notification will be hidden after the click on that but stays in the status bar.
  • Call notifications can not be dismissed, because of CallStyle used.
  • If microphone permission is not granted, the app will open incoming call screen when clicking on Answer call to show the permission dialog there
Screen_recording_20241106_100215.webm

Needs releases with:

  • GitHub link to other pull request

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Briefly describe how this change was tested and if applicable the exact steps taken to verify that it works as expected.

Notes (Optional)

Specify here any other facts that you think are important for this issue.

Attachments (Optional)

Attachments like images, videos, etc. (drag and drop in the text box)


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@echoes-hq echoes-hq bot added the echoes: bugs Technical or functional defects in the product label Nov 6, 2024
@ohassine ohassine requested review from a team, typfel, borichellow, MohamadJaara, saleniuk and mathias-niboulies and removed request for a team November 6, 2024 09:04
@ohassine ohassine requested review from Garzas and removed request for mathias-niboulies November 6, 2024 09:04
@codecov-commenter
Copy link

codecov-commenter commented Nov 6, 2024

Codecov Report

Attention: Patch coverage is 2.12766% with 46 lines in your changes missing coverage. Please review.

Project coverage is 45.32%. Comparing base (e3c1dee) to head (8532cea).

Files with missing lines Patch % Lines
...re/android/notification/CallNotificationManager.kt 0.00% 21 Missing ⚠️
...in/com/wire/android/notification/PendingIntents.kt 0.00% 17 Missing ⚠️
...n/broadcastreceivers/IncomingCallActionReceiver.kt 12.50% 7 Missing ⚠️
...in/kotlin/com/wire/android/services/CallService.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3592      +/-   ##
===========================================
- Coverage    45.33%   45.32%   -0.02%     
===========================================
  Files          472      471       -1     
  Lines        15794    15781      -13     
  Branches      2632     2632              
===========================================
- Hits          7160     7152       -8     
+ Misses        7884     7880       -4     
+ Partials       750      749       -1     
Files with missing lines Coverage Δ
...m/wire/android/notification/NotificationActions.kt 0.00% <ø> (ø)
...in/kotlin/com/wire/android/services/CallService.kt 3.12% <0.00%> (+0.09%) ⬆️
...n/broadcastreceivers/IncomingCallActionReceiver.kt 3.57% <12.50%> (ø)
...in/com/wire/android/notification/PendingIntents.kt 0.00% <0.00%> (ø)
...re/android/notification/CallNotificationManager.kt 33.10% <0.00%> (-4.32%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e3c1dee...8532cea. Read the comment docs.

Copy link
Contributor

github-actions bot commented Nov 6, 2024

Built wire-android-staging-compat-pr-3592.apk is available for download

Copy link
Contributor

github-actions bot commented Nov 6, 2024

Built wire-android-dev-debug-pr-3592.apk is available for download

Copy link

sonarcloud bot commented Nov 7, 2024

.setCategory(NotificationCompat.CATEGORY_CALL)
.setSmallIcon(R.drawable.notification_icon_small)
.setContentTitle(data.conversationName)
.setContentText(context.getString(R.string.notification_outgoing_call_tap_to_return))
.setAutoCancel(false)
.setOngoing(true)
.setSilent(true)
.setStyle(
CallStyle.forOngoingCall(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we remove reloadIfNeeded completely then can we also make outgoing and ongoing call notifications to be of the CallStyle so that they cannot be dismissed as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes: bugs Technical or functional defects in the product size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants