diff --git a/python-for-android/dists/kolibri/src/main/java/org/kivy/android/PythonWorker.java b/python-for-android/dists/kolibri/src/main/java/org/kivy/android/PythonWorker.java index d62ecaf..9ea0266 100644 --- a/python-for-android/dists/kolibri/src/main/java/org/kivy/android/PythonWorker.java +++ b/python-for-android/dists/kolibri/src/main/java/org/kivy/android/PythonWorker.java @@ -22,8 +22,7 @@ public class PythonWorker { private final String pythonPath; public PythonWorker(@NonNull Context context, String pythonName, String workerEntrypoint) { -// PythonLoader.doLoad(context); - PythonUtil.loadLibraries(new File(context.getApplicationInfo().nativeLibraryDir)); + PythonLoader.doLoad(context); this.pythonName = pythonName; this.workerEntrypoint = workerEntrypoint; 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 8be15c4..ffc2897 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 @@ -34,12 +34,14 @@ public Result doWork() { Log.d(TAG, "Running background task " + getId()); final String id = getId().toString(); final String arg = getArgument(); - return workerImpl.execute(id, arg) ? Result.success() : Result.failure(); + Result r = workerImpl.execute(id, arg) ? Result.success() : Result.failure(); + hideNotification(); + return r; } @Override public void onStopped() { - Log.d(TAG, "Stopping foreground remote task " + getId()); + Log.d(TAG, "Stopping background 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 060ccf6..a7c2c3f 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 @@ -68,6 +68,10 @@ public ListenableFuture startRemoteWork() { threadFuture.cancel(true); } } + + if (future.isDone()) { + hideNotification(); + } } }, getTaskExecutor().getMainThreadExecutor()); return future; diff --git a/python-for-android/dists/kolibri/src/main/java/org/learningequality/Kolibri/WorkerService.java b/python-for-android/dists/kolibri/src/main/java/org/learningequality/Kolibri/WorkerService.java index 4654c91..68a4bb5 100644 --- a/python-for-android/dists/kolibri/src/main/java/org/learningequality/Kolibri/WorkerService.java +++ b/python-for-android/dists/kolibri/src/main/java/org/learningequality/Kolibri/WorkerService.java @@ -22,9 +22,6 @@ public class WorkerService extends RemoteWorkerService implements Notifier { public void onCreate() { Log.d(TAG, "Initializing foreground worker service"); super.onCreate(); - // We could potentially remove this and leave the notification up to long-running workers - // bound to the service - sendNotification(); mService = this; }