Oreo requires that each notification has a channel assigned. This patch uses a common channel for all. Individual channels for different notifications (Notifications plugin, pairing notifications, share plugin) could be done, but
since in our case notifications are not a critical part of the UX it does not seem necessary to me. Setting the channel on NotificationCompat.Builder requires version 26 of the support library, the implications of this were
discussed in D8966.
Details
- Reviewers
- None
- Group Reviewers
KDE Connect - Commits
- R225:73bf3e6fa1dc: Add channel to notifications.
R225:ef77b8d60f67: Add channel to notifications.
Diff Detail
- Repository
- R225 KDE Connect - Android application
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
At some point we should bump to API 26 and then also merge D8966, but I'm unsure if this si something we should do right now or if it can wait. In the case of this patch, probably there is a "compatibility" behaviour for old apps that don't set a channel. I'm not sure what's that behavior, but maybe we can go with that for a while? If they just don't work, then it means we should bump to 26 asap, but I don't think they went that way.
Targeting Oreo has to wait until we made all the necessary changes, that's why I did not bump it yet. The NotificationCompat.Builder(context, channelD) accepts an empty channel on target < Oreo, the problem is that it doesn't compile without version 26 of the support library.
Looks good to me, and still works on Android 7.1.
Regarding the compability with old android versions: we could release a final version of the app for API version < 14. Then users of old versions still have a working app, although they won't get updates anymore.