diff --git a/python-for-android/dists/kolibri/src/main/java/org/learningequality/Kolibri/BackgroundWorker.java b/python-for-android/dists/kolibri/src/main/java/org/learningequality/Kolibri/BackgroundWorker.java index 677b5700..8be15c4d 100644 --- a/python-for-android/dists/kolibri/src/main/java/org/learningequality/Kolibri/BackgroundWorker.java +++ b/python-for-android/dists/kolibri/src/main/java/org/learningequality/Kolibri/BackgroundWorker.java @@ -36,4 +36,11 @@ public Result doWork() { final String arg = getArgument(); return workerImpl.execute(id, arg) ? Result.success() : Result.failure(); } + + @Override + public void onStopped() { + Log.d(TAG, "Stopping foreground remote task " + getId()); + super.onStopped(); + hideNotification(); + } } diff --git a/python-for-android/dists/kolibri/src/main/java/org/learningequality/Kolibri/ForegroundWorker.java b/python-for-android/dists/kolibri/src/main/java/org/learningequality/Kolibri/ForegroundWorker.java index 95db6d6e..dc5d5a76 100644 --- a/python-for-android/dists/kolibri/src/main/java/org/learningequality/Kolibri/ForegroundWorker.java +++ b/python-for-android/dists/kolibri/src/main/java/org/learningequality/Kolibri/ForegroundWorker.java @@ -73,6 +73,13 @@ public ListenableFuture startRemoteWork() { return future; } + @Override + public void onStopped() { + Log.d(TAG, "Stopping foreground remote task " + getId()); + super.onStopped(); + hideNotification(); + } + public ForegroundInfo getForegroundInfo() { NotificationRef ref = getNotificationRef(); // If we are running in the service, use the service notification ref