also gather music info from notifications when screen is off
This commit is contained in:
parent
9623449b6e
commit
b0fe4b1519
|
@ -169,13 +169,6 @@ public class NotificationListener extends NotificationListenerService {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Prefs prefs = GBApplication.getPrefs();
|
|
||||||
if (!prefs.getBoolean("notifications_generic_whenscreenon", false)) {
|
|
||||||
PowerManager powermanager = (PowerManager) getSystemService(POWER_SERVICE);
|
|
||||||
if (powermanager.isScreenOn()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
switch (GBApplication.getGrantedInterruptionFilter()) {
|
switch (GBApplication.getGrantedInterruptionFilter()) {
|
||||||
case NotificationManager.INTERRUPTION_FILTER_ALL:
|
case NotificationManager.INTERRUPTION_FILTER_ALL:
|
||||||
break;
|
break;
|
||||||
|
@ -193,6 +186,14 @@ public class NotificationListener extends NotificationListenerService {
|
||||||
if (handleMediaSessionNotification(notification))
|
if (handleMediaSessionNotification(notification))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Prefs prefs = GBApplication.getPrefs();
|
||||||
|
if (!prefs.getBoolean("notifications_generic_whenscreenon", false)) {
|
||||||
|
PowerManager powermanager = (PowerManager) getSystemService(POWER_SERVICE);
|
||||||
|
if (powermanager.isScreenOn()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((notification.flags & Notification.FLAG_ONGOING_EVENT) == Notification.FLAG_ONGOING_EVENT) {
|
if ((notification.flags & Notification.FLAG_ONGOING_EVENT) == Notification.FLAG_ONGOING_EVENT) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue