Skip to content

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

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

Open
zhao-gang opened this issue Feb 28, 2019 · 7 comments · Fixed by #2529
Open

Comments

@zhao-gang
Copy link
Contributor

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

@nicolas-raoul
Copy link
Member

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

zhao-gang added a commit to zhao-gang/apps-android-commons that referenced this issue Feb 28, 2019
…s-app#2528)

Add setOnlyAlertOnce flag to NotificationCompat.Builder. This fixed
the issue that notification makes an alarm(beep) every time uploading
progress updated on some devices.

Also let UploadService.class reuse NotificationCompat.Builder as much
as possible(instead of creating a NotificationCompat.Builder every
time in method uploadContribution). And some small refactors.
misaochan pushed a commit that referenced this issue Feb 28, 2019
…#2529)

Add setOnlyAlertOnce flag to NotificationCompat.Builder. This fixed
the issue that notification makes an alarm(beep) every time uploading
progress updated on some devices.

Also let UploadService.class reuse NotificationCompat.Builder as much
as possible(instead of creating a NotificationCompat.Builder every
time in method uploadContribution). And some small refactors.
@zhao-gang zhao-gang changed the title Notification makes an alarm(beep) every time uploading progress updated Notification makes an alarm(beep) every time uploading / DeleteTask progress updated Mar 3, 2019
@zhao-gang zhao-gang changed the title Notification makes an alarm(beep) every time uploading / DeleteTask progress updated Notification makes an alarm(beep) every time when uploading / DeleteTask progress updated Mar 3, 2019
zhao-gang added a commit to zhao-gang/apps-android-commons that referenced this issue Mar 3, 2019
…p#2528)

As commit ab4fca5 does, this commit fixed the repeated notification
alarms in DeleteTask.class.

Since progress indication in notification can be cleared by calling
.setProgress(0,0,false) on notificationBuilder(As shown in DeleteTask.class).
This commit also refactored notification related code in UploadService.class.
Make progress and failed notification uses the same notificationBuilder.
neslihanturan pushed a commit that referenced this issue Mar 12, 2019
)

As commit ab4fca5 does, this commit fixed the repeated notification
alarms in DeleteTask.class.

Since progress indication in notification can be cleared by calling
.setProgress(0,0,false) on notificationBuilder(As shown in DeleteTask.class).
This commit also refactored notification related code in UploadService.class.
Make progress and failed notification uses the same notificationBuilder.
@neslihanturan neslihanturan reopened this Apr 17, 2019
@neslihanturan
Copy link
Collaborator

Still happens, on current master with API 26 emultor

@zhao-gang
Copy link
Contributor Author

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.

@neslihanturan
Copy link
Collaborator

Thanks @zhao-gang it was helpful!

@andrew-tc
Copy link

andrew-tc commented Oct 3, 2020

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?

@nicolas-raoul
Copy link
Member

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

@nicolas-raoul
Copy link
Member

@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

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

Successfully merging a pull request may close this issue.

4 participants