start DummyService only if there is Notification ready

This commit is contained in:
Milos Kozak 2019-06-29 10:59:10 +02:00
parent 6ccf3788be
commit df2ae1c52f

View file

@ -112,10 +112,11 @@ public class PersistentNotificationPlugin extends PluginBase {
}
private void triggerNotificationUpdate() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
MainApp.instance().startForegroundService(new Intent(MainApp.instance(), DummyService.class));
else
MainApp.instance().startService(new Intent(MainApp.instance(), DummyService.class));
if (updateNotification() != null)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
MainApp.instance().startForegroundService(new Intent(MainApp.instance(), DummyService.class));
else
MainApp.instance().startService(new Intent(MainApp.instance(), DummyService.class));
}
Notification updateNotification() {