From bf54e0e7c7f393a68cf0f6f15ecedcab99d3eeb8 Mon Sep 17 00:00:00 2001 From: Brad Pitcher Date: Thu, 18 Apr 2019 21:45:11 -0700 Subject: [PATCH] avoid "app not responding" errors loading widget image --- .../antennapod/core/service/PlayerWidgetJobService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java b/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java index d79843b15..0c32527aa 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java @@ -20,6 +20,8 @@ import android.widget.RemoteViews; import com.bumptech.glide.Glide; import com.bumptech.glide.request.RequestOptions; +import java.util.concurrent.TimeUnit; + import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.glide.ApGlideSettings; import de.danoeh.antennapod.core.receiver.MediaButtonReceiver; @@ -124,7 +126,7 @@ public class PlayerWidgetJobService extends SafeJobIntentService { .load(media.getImageLocation()) .apply(RequestOptions.diskCacheStrategyOf(ApGlideSettings.AP_DISK_CACHE_STRATEGY)) .submit(iconSize, iconSize) - .get(); + .get(500, TimeUnit.MILLISECONDS); views.setImageViewBitmap(R.id.imgvCover, icon); } catch (Throwable tr) { Log.e(TAG, "Error loading the media icon for the widget", tr);