Skip to content

Backport/6079/improve answering calls#6085

Open
mahibi wants to merge 6 commits intostable-23.0from
backport/6079/Improve-answering-calls
Open

Backport/6079/improve answering calls#6085
mahibi wants to merge 6 commits intostable-23.0from
backport/6079/Improve-answering-calls

Conversation

@mahibi
Copy link
Copy Markdown
Collaborator

@mahibi mahibi commented Apr 16, 2026

manual backport of #6015
replacing #6079

🖼️ Screenshots

🏚️ Before 🏡 After
B A

🚧 TODO

  • ...

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔖 Capability is checked or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

anakin78z and others added 6 commits April 16, 2026 12:11
Switched call notification to NotificationCompat.CallStyle.
This adds answer/decline buttons to the notification
so that users can answer incoming calls.

Adds caller avatar to notification.

Signed-off-by: Jens Zalzala <jens@shakingearthdigital.com>
Signed-off-by: Jens Zalzala <jens@shakingearthdigital.com>
Signed-off-by: Jens Zalzala <jens@shakingearthdigital.com>
Do not cancel the notifications in getRoomnstead, but do it with

NotificationManagerCompat.from(this).cancel(notificationId)

in processExtras (see commit dcde0be).

It seems that things can go wrong that cancelExistingNotificationsForRoom was not reached which caused an indefinite ringing.
The underlying cause why this is not reached is NOT fixed with this commit, but instead dismissing the notification in processExtras seems to be like a more reliable approach.

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
new method from 6a6d4d2 with darkMode support is not backported to avoid backport chains.

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
@mahibi mahibi added this to the 23.0.1 milestone Apr 16, 2026
@mahibi mahibi self-assigned this Apr 16, 2026
Copilot AI review requested due to automatic review settings April 16, 2026 11:00
@mahibi mahibi added the 3. to review Waiting for reviews label Apr 16, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Backport of Talk Android changes to improve the incoming-call experience (notification actions, ringing behavior after answering, and lock-screen behavior), aligning stable branch behavior with PR #6015.

Changes:

  • Add NotificationCompat.CallStyle incoming-call notification with answer/decline actions and caller avatar support.
  • Cancel the ringing notification when an incoming call is answered, and adjust lock-screen/keyguard handling.
  • Register a new DeclineCallReceiver and update Gradle verification metadata.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
gradle/verification-metadata.xml Updates dependency verification metadata entries (sha entries / also-trust).
app/src/main/java/com/nextcloud/talk/receivers/DeclineCallReceiver.kt Adds receiver used by the notification “Decline” action to cancel the call notification.
app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.kt Builds improved incoming call notifications (CallStyle), adds answer/decline PendingIntents, adjusts threading.
app/src/main/java/com/nextcloud/talk/activities/CallBaseActivity.java Changes keyguard/lock-screen behavior when showing call UI.
app/src/main/java/com/nextcloud/talk/activities/CallActivity.kt Cancels incoming-call notification after answering; adjusts initial camera enabling behavior.
app/src/main/AndroidManifest.xml Registers DeclineCallReceiver.
Comments suppressed due to low confidence (1)

app/src/main/java/com/nextcloud/talk/activities/CallBaseActivity.java:82

  • dismissKeyguard() no longer dismisses the keyguard (it only sets show-when-locked/turn-screen-on flags). This makes the method name misleading and also leaves enableKeyguard() clearing FLAG_DISMISS_KEYGUARD even though it's no longer set anywhere in this flow. Consider renaming the method (or updating documentation) and keeping the enable/disable flag handling consistent.
    void dismissKeyguard() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
            setShowWhenLocked(true);
            setTurnScreenOn(true);
        } else {
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
        }
    }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1040 to +1043
// don't enable the camera if call was answered via notification
if (!isIncomingCallFromNotification) {
onCameraClick()
}
Comment on lines +293 to +299
val declinePendingIntent = PendingIntent.getBroadcast(
applicationContext,
requestCode + DECLINE_CALL_REQUEST_OFFSET,
Intent(applicationContext, DeclineCallReceiver::class.java).apply {
putExtra(KEY_NOTIFICATION_TIMESTAMP, pushMessage.timestamp.toInt())
},
pendingIntentFlags
Comment on lines +557 to +561
val notificationId = extras.getInt(KEY_NOTIFICATION_TIMESTAMP, 0)
if (notificationId != 0) {
// cancel the notification to stop the call ringing
NotificationManagerCompat.from(this).cancel(notificationId)
}
@github-actions
Copy link
Copy Markdown
Contributor

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/6085.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

@github-actions
Copy link
Copy Markdown
Contributor

Codacy

Lint

TypemasterPR
Warnings8898
Errors00

SpotBugs

CategoryBaseNew
Bad practice66
Correctness1010
Dodgy code5354
Internationalization33
Malicious code vulnerability33
Performance44
Security11
Total8081

SpotBugs increased!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants