Bläddra i källkod

Fix #279

Signed-off-by: Mario Danic <mario@lovelyhq.com>
Mario Danic 6 år sedan
förälder
incheckning
4ea5f2e226

+ 8 - 4
app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java

@@ -299,10 +299,14 @@ public class CallNotificationController extends BaseController {
 
         renderScript = RenderScript.create(getActivity());
 
-        try {
-            cache.evictAll();
-        } catch (IOException e) {
-            Log.e(TAG, "Failed to evict cache");
+        if (handler == null) {
+            handler = new Handler();
+
+            try {
+                cache.evictAll();
+            } catch (IOException e) {
+                Log.e(TAG, "Failed to evict cache");
+            }
         }
 
         if (currentConversation == null) {

+ 4 - 4
app/src/main/java/com/nextcloud/talk/utils/singletons/ApplicationWideApiHolder.java

@@ -38,8 +38,8 @@ import autodagger.AutoInjector;
 import retrofit2.Retrofit;
 
 @AutoInjector(NextcloudTalkApplication.class)
-public class ApiHolder {
-    private static final String TAG = "ApiHolder";
+public class ApplicationWideApiHolder {
+    private static final String TAG = "ApplicationWideApiHolder";
 
     @SuppressLint("UseSparseArrays")
     private Map<Long, NcApi> ncApiHashMap;
@@ -50,9 +50,9 @@ public class ApiHolder {
     @Inject
     Retrofit retrofit;
 
-    private static final ApiHolder holder = new ApiHolder();
+    private static final ApplicationWideApiHolder holder = new ApplicationWideApiHolder();
 
-    public static ApiHolder getInstance() {
+    public static ApplicationWideApiHolder getInstance() {
         return holder;
     }