1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-26 06:11:19 +00:00

Fix incorrect initialization of Info notification channel (#2040)

I was using syncthing as a reference for handling notifications in my
app, when I noticed that the "Info" channel appears to be incorrectly
initialized.

It looks like it was intended for the Info channel not to vibrate, not
to make sound, but only to show a badge. This might be redundant as it's
possible every notification pushed to this channel already follows those
standards, I am unsure. However, the code used to initialize the Info
channel was actually modifying the already created Persistent channel,
and thus did nothing.

This pull request fixes, what I think are typos which originated from a
copy and paste of the code used to create the Persistent channel.

I think these lines should either be changed as per this pull request,
or removed entirely.
This commit is contained in:
The Eclectic Dyslexic 2024-01-26 22:22:27 -08:00 committed by GitHub
parent bbd543582a
commit a22c1b99a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -73,9 +73,9 @@ public class NotificationHandler {
mInfoChannel = new NotificationChannel( mInfoChannel = new NotificationChannel(
CHANNEL_INFO, mContext.getString(R.string.notifications_other_channel), CHANNEL_INFO, mContext.getString(R.string.notifications_other_channel),
NotificationManager.IMPORTANCE_LOW); NotificationManager.IMPORTANCE_LOW);
mPersistentChannel.enableVibration(false); mInfoChannel.enableVibration(false);
mPersistentChannel.setSound(null, null); mInfoChannel.setSound(null, null);
mPersistentChannel.setShowBadge(true); mInfoChannel.setShowBadge(true);
mNotificationManager.createNotificationChannel(mInfoChannel); mNotificationManager.createNotificationChannel(mInfoChannel);
} else { } else {
mPersistentChannel = null; mPersistentChannel = null;