Skip to content
This repository was archived by the owner on Dec 3, 2024. It is now read-only.

Commit a22c1b9

Browse files
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.
1 parent bbd5435 commit a22c1b9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/src/main/java/com/nutomic/syncthingandroid/service/NotificationHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ public NotificationHandler(Context context) {
7373
mInfoChannel = new NotificationChannel(
7474
CHANNEL_INFO, mContext.getString(R.string.notifications_other_channel),
7575
NotificationManager.IMPORTANCE_LOW);
76-
mPersistentChannel.enableVibration(false);
77-
mPersistentChannel.setSound(null, null);
78-
mPersistentChannel.setShowBadge(true);
76+
mInfoChannel.enableVibration(false);
77+
mInfoChannel.setSound(null, null);
78+
mInfoChannel.setShowBadge(true);
7979
mNotificationManager.createNotificationChannel(mInfoChannel);
8080
} else {
8181
mPersistentChannel = null;

0 commit comments

Comments
 (0)