From 50b4aac2630a44575750e46a4caddcb47ad1b018 Mon Sep 17 00:00:00 2001 From: Peter Serwylo Date: Thu, 30 Nov 2017 08:09:55 +1100 Subject: [PATCH] Correctly re-initialize loaders in updates screen. There used to be a single loader which would get all apps which have updates available. This was restarted when we were notified about new apps requiring updates. Then, in 7424220 I introduced a second loader responsible for getting apps with known vulnerabilities. This change caused the bug in #1203, because it changed the loaders from a single loader with ID = 0, to two different loaders with arbitrary IDs. However, there was still a line of code responding to when repo updates completed and we learn about new updateable apps, and this was asking for a loader with an ID of 0 like before. This crashed when the loader was completed and we tried to pase the results. This is fixed ensuring that both loaders are restarted upon learning of new updateable apps. To prevent this disconnect in the future, they are also extracted into the same method. --- .../fdroid/fdroid/views/updates/UpdatesAdapter.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/fdroid/fdroid/views/updates/UpdatesAdapter.java b/app/src/main/java/org/fdroid/fdroid/views/updates/UpdatesAdapter.java index c657fe498..51f1ae792 100644 --- a/app/src/main/java/org/fdroid/fdroid/views/updates/UpdatesAdapter.java +++ b/app/src/main/java/org/fdroid/fdroid/views/updates/UpdatesAdapter.java @@ -89,8 +89,7 @@ public class UpdatesAdapter extends RecyclerView.Adapter