Bug 457181

Summary: KDE Connect android app does not push all notifications to desktop
Product: [Applications] kdeconnect Reporter: chemistudio <chemistudio>
Component: android-applicationAssignee: Albert Vaca Cintora <albertvaka>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Android   
OS: Unspecified   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description chemistudio@gmail.com 2022-07-27 03:57:28 UTC
SUMMARY
It is a well-known inconvenience of KDE Connect android app. Some apps, for example, [wechat](https://weixin.qq.com) notifications are not pushed to desktop. The notifications appear at the phone side and nothing happened on desktop side.

The code is in NotificationsPlugin.java, line #192. For some reason, those notifications are with flag FLAG_LOCAL_ONLY, so that KDE Connect android app filters them off.
```java
        if ((notification.flags & Notification.FLAG_FOREGROUND_SERVICE) != 0
                || (notification.flags & Notification.FLAG_ONGOING_EVENT) != 0
                || (notification.flags & Notification.FLAG_LOCAL_ONLY) != 0
                || (notification.flags & NotificationCompat.FLAG_GROUP_SUMMARY) != 0 //The notification that groups other notifications
        )
        {
            //This is not a notification we want!
            return;
        }
```

The workaround is remove line #192, and recompile the app from source.

STEPS TO REPRODUCE
1. Install and configure KDE Connect android app.
2. Some notifications of phone apps popped up, and nothing happened to desktop KDE Connect or gsconnect.

OBSERVED RESULT
Notifications with FLAG_LOCAL_ONLY are not pushed to desktop.

EXPECTED RESULT
Notifications with FLAG_LOCAL_ONLY should be pushed to desktop, or leave the choice to the user whether they should be pushed.