From 19a84fc82cf33799401c1ce8b027f873c017d213 Mon Sep 17 00:00:00 2001 From: Courville Software Date: Thu, 12 Dec 2024 19:40:10 +0100 Subject: [PATCH] VideoStoreImportService: another attempt to stop when app goes background See https://github.com/nova-video-player/aos-AVP/issues/1338 --- .../archos/mediaprovider/video/VideoStoreImportService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/com/archos/mediaprovider/video/VideoStoreImportService.java b/src/com/archos/mediaprovider/video/VideoStoreImportService.java index a840c075..7068d000 100644 --- a/src/com/archos/mediaprovider/video/VideoStoreImportService.java +++ b/src/com/archos/mediaprovider/video/VideoStoreImportService.java @@ -240,6 +240,12 @@ public int onStartCommand(Intent intent, int flags, int startId) { ArchosUtils.addBreadcrumb(SentryLevel.INFO, "VideoStoreImportService.onStartCommand", "created notification + startForeground " + NOTIFICATION_ID + " notification null? " + (n == null)); log.debug("onStartCommand: created notification + startForeground " + NOTIFICATION_ID + " notification null? " + (n == null)); + if (!AppState.isForeGround()) { + cleanup(); + stopSelf(); + return START_NOT_STICKY; + } + if (intent == null || intent.getAction() == null) { // do a full import here to make sure that we have initial data log.debug("onStartCommand: intent == null || intent.getAction() == null do MESSAGE_IMPORT_FULL");