start DummyService only if there is Notification ready
This commit is contained in:
parent
6ccf3788be
commit
df2ae1c52f
1 changed files with 5 additions and 4 deletions
|
@ -112,10 +112,11 @@ public class PersistentNotificationPlugin extends PluginBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void triggerNotificationUpdate() {
|
private void triggerNotificationUpdate() {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
if (updateNotification() != null)
|
||||||
MainApp.instance().startForegroundService(new Intent(MainApp.instance(), DummyService.class));
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
||||||
else
|
MainApp.instance().startForegroundService(new Intent(MainApp.instance(), DummyService.class));
|
||||||
MainApp.instance().startService(new Intent(MainApp.instance(), DummyService.class));
|
else
|
||||||
|
MainApp.instance().startService(new Intent(MainApp.instance(), DummyService.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
Notification updateNotification() {
|
Notification updateNotification() {
|
||||||
|
|
Loading…
Reference in a new issue