From f5f5007733912797e25f1a872a4c207492351568 Mon Sep 17 00:00:00 2001 From: Isira Seneviratne Date: Mon, 13 Jul 2020 16:40:58 +0530 Subject: [PATCH] Fix exceptions being thrown when retrieving project icons. --- .../src/main/java/edu/berkeley/boinc/client/ClientStatus.java | 3 +++ .../app/src/main/java/edu/berkeley/boinc/client/Monitor.kt | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/android/BOINC/app/src/main/java/edu/berkeley/boinc/client/ClientStatus.java b/android/BOINC/app/src/main/java/edu/berkeley/boinc/client/ClientStatus.java index 181ffbc97c..e342325c15 100644 --- a/android/BOINC/app/src/main/java/edu/berkeley/boinc/client/ClientStatus.java +++ b/android/BOINC/app/src/main/java/edu/berkeley/boinc/client/ClientStatus.java @@ -29,6 +29,7 @@ import android.os.PowerManager.WakeLock; import android.text.format.DateUtils; import android.util.Log; +import androidx.annotation.Nullable; import androidx.collection.ArraySet; import androidx.core.content.ContextCompat; @@ -450,6 +451,7 @@ public class ClientStatus { // returns project icon for given master url // bitmap: 40 * 40 pixel, symbolic link in /projects/PNAME/stat_icon + @Nullable public synchronized Bitmap getProjectIcon(String masterUrl) { if(Logging.VERBOSE) { Log.v(Logging.TAG, "getProjectIcon for: " + masterUrl); @@ -486,6 +488,7 @@ public class ClientStatus { // returns project icon for given project name // bitmap: 40 * 40 pixel, symbolic link in /projects/PNAME/stat_icon + @Nullable public synchronized Bitmap getProjectIconByName(String projectName) { if(Logging.VERBOSE) { Log.v(Logging.TAG, "getProjectIconByName for: " + projectName); diff --git a/android/BOINC/app/src/main/java/edu/berkeley/boinc/client/Monitor.kt b/android/BOINC/app/src/main/java/edu/berkeley/boinc/client/Monitor.kt index e2eda7efdd..d454698d89 100644 --- a/android/BOINC/app/src/main/java/edu/berkeley/boinc/client/Monitor.kt +++ b/android/BOINC/app/src/main/java/edu/berkeley/boinc/client/Monitor.kt @@ -1102,12 +1102,12 @@ class Monitor : LifecycleService() { } @Throws(RemoteException::class) - override fun getProjectIconByName(name: String): Bitmap { + override fun getProjectIconByName(name: String): Bitmap? { return clientStatus.getProjectIconByName(name) } @Throws(RemoteException::class) - override fun getProjectIcon(id: String): Bitmap { + override fun getProjectIcon(id: String): Bitmap? { return clientStatus.getProjectIcon(id) }