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() {
|
||||
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() {
|
||||
|
|
Loading…
Reference in a new issue