apps-android-commons icon indicating copy to clipboard operation
apps-android-commons copied to clipboard

Notification makes an alarm(beep) every time when uploading / DeleteTask progress updated

Open zhao-gang opened this issue 7 years ago • 10 comments

Summary:

When uploading a file, notification makes a sound every time the uploading progress updated. Which is very annoying.

System logs:

The current notification also generate some system error logs like:

2019-02-28 12:33:22.138 796-796/? E/NotificationService: Muting recently noisy 0|fr.free.nrw.commons.beta|1|null|10398

Device and Android version:

Nexus 6P(with Android Oreo) and Pixel 2 XL(with Android Pie) have above issue.

Commons app version:

master betaDebug

Would you like to work on the issue?

Yes

zhao-gang avatar Feb 28 '19 04:02 zhao-gang

I have never noticed that, but I remember someone talking about it.

nicolas-raoul avatar Feb 28 '19 04:02 nicolas-raoul

Still happens, on current master with API 26 emultor

neslihanturan avatar Apr 17 '19 10:04 neslihanturan

The previous fix used setOnlyAlertOnce to let the notification only alert once. It fixed the repeating alert on some devices with API level 27/28. I searched "setOnlyAlertOnce api 26" on the web and didn't find any interesting results.

Unfortunately I don't have the environment to test this issue on API 26 emulator. Hope above information can help to resolve this issue on API 26 emulator.

zhao-gang avatar Apr 18 '19 07:04 zhao-gang

Thanks @zhao-gang it was helpful!

neslihanturan avatar Apr 18 '19 08:04 neslihanturan

Hi @neslihanturan , I'm new to contributing to OSS and I'd like to help with fixing this issue.

However, I tried this on the current master branch and API 25 emulator, but it seems I'm unable to repro it while uploading the file (not yet tested on deletion); there's no notification sound for me. Perhaps I'm doing something wrong, but may I know the current status of this issue?

andrew-tc avatar Oct 03 '20 17:10 andrew-tc

@andrew-tc Could you please try with API 26 emulator?

nicolas-raoul avatar Oct 04 '20 13:10 nicolas-raoul

@pigsonthewing reports an audio alert notification that an upload has started, on a OnePlus Nord, running OxygenOS, v. 10.5.10.AC018A - https://en.wikipedia.org/wiki/OxygenOS

nicolas-raoul avatar Feb 17 '21 01:02 nicolas-raoul

This is still an issue for me.

pigsonthewing avatar Jul 05 '26 16:07 pigsonthewing

I'd like to work on this. Could it be assigned to me?

This still happens in the current code, which matches @pigsonthewing's report from July. The 2019 fixes (#2529, #2538) changed UploadService.java, which has since been replaced by UploadWorker. In UploadWorker, all upload notifications (the foreground service one, "Starting uploads" and each file's progress) are posted on NOTIFICATION_CHANNEL_ID_ALL, which has IMPORTANCE_DEFAULT, so every new post plays a sound. setOnlyAlertOnce(true) only silences updates to a notification that is still showing. But the "Starting uploads" notification is cancelled on every progress update and posted again for the next file, and each file gets its own new notification, so the sound plays again and again.

Proposed fix: post the in-progress notifications on a new upload channel with IMPORTANCE_LOW (still shown, but silent), and keep the finished and failed notifications on the current channel so they still alert once. I'd add unit tests for which channel each notification uses.

Should the "upload finished" notification still make a sound, or would you prefer all upload notifications to be silent?

yuvarajvodiboina avatar Oct 21 '26 12:10 yuvarajvodiboina

Thanks for assigning this! I've opened #7071 with the fix. Upload progress notifications now go to a new "Upload progress" notification channel, which is silent, while finished and failed uploads still alert once. The PR has before/after screenshots of the app's notification settings.

If you'd prefer finished uploads to be silent too, that's a one-line change.

yuvarajvodiboina avatar Oct 21 '26 13:10 yuvarajvodiboina