fandreuz / TUI-ConsoleLauncher

Linux CLI Launcher for Android
Other
1.24k stars 256 forks source link

Notification longpress -> "Exclude notification" doesn't create filters that work. #193

Open stephengeorgewest opened 6 years ago

stephengeorgewest commented 6 years ago

Notification longpress -> "Exclude notification" creates filters like: <filter id="-1" value="[%t] %pkg: Syncing… --- Title "/> and <filter id="-1" value="[%t] %pkg: Syncthing is running --- null"/>. %t and %pkg appear to be breaking the filter. Should they be replaced before the regex is checked? Or perhaps create a value string and in it replace %t with a time regex and %pkg/`%app' with the package/app name? I've replaced them with working regexes, but it took me a while to get to the issue.

<filter value="Syncthing is running"/>
<!--<filter value="Syncthing: Syncing…"/>-->
<filter value="Syncthing is disabled"/>

The path to discovering the issue:

screenshot_20180707-063811 longpressing the notification and selecting "Exclude notification" put these in the notifications.xml file:

<filter id="-1" value="[%t] %pkg: Syncing… --- Title "/>
...
<filter id="-1" value="[%t] %pkg: Syncthing is running --- null"/>
<filter id="-1" value="[%t] %pkg: Syncthing is disabled --- null"/>
<filter id="-1" value="[%t] %pkg: Syncthing is running --- null"/>
<filter id="-1" value="[%t] %pkg: Syncthing is disabled --- null"/>

but they weren't working. I cleaned up the extras, and found that if I comment out the "Syncing… --- Title" one then it appears to filter the notifications;

<filter id="-1" value="[%t] %pkg: Syncthing is running --- null"/>
<!--<filter id="-1" value="[%t] %pkg: Syncing… --- Title "/>-->
<filter id="-1" value="[%t] %pkg: Syncthing is disabled --- null"/>

I also noticed that if I apply a non negative id and create an "apply", then it also starts filter these notifications:

<apply id="3" package="com.nutomic.synthingandroid"/>
<filter id="3" value="[%t] %pkg: Syncthing is running --- null"/>
<filter id="3" value="[%t] %pkg: Syncing… --- Title "/>
<filter id="3" value="[%t] %pkg: Syncthing is disabled --- null"/>

And by "work" i mean, they appear to be all or nothing. I can't get them to go one at a time. This also prevents all notifications.

<!--<filter id="-1" value="[%t] %pkg: Syncthing is running --- null"/>
<filter id="-1" value="[%t] %pkg: Syncing… --- Title "/>-->
<filter id="-1" value="[%t] %pkg: Syncthing is disabled --- null"/>

Looking at the documentation, apply isn't a thing anymore? I'll have to re-work some filters now. I tried limiting the "value" and that seems to work.

<filter value="Syncthing is running"/>
<!--<filter value="Syncthing: Syncing…"/>-->
<filter value="Syncthing is disabled"/>
fastergov commented 6 years ago

An update came out that said to have corrected this, we will see ...

Version 6.7 (code: 190)