summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/Bookmarks.java
diff options
context:
space:
mode:
authorPawit Pornkitprasan <p.pawit@gmail.com>2014-04-16 09:10:16 +0700
committerSteve Kondik <steve@cyngn.com>2015-11-07 13:57:46 -0800
commit570656d8a6505003cb3dc6cd35d091928a48d41d (patch)
treef3798262a5c00d3c43919b347fee793e369183c7 /src/com/android/browser/Bookmarks.java
parentbba05e7be2ceccc1df6bb6c26f02b985e21d6997 (diff)
downloadpackages_apps_Browser-570656d8a6505003cb3dc6cd35d091928a48d41d.zip
packages_apps_Browser-570656d8a6505003cb3dc6cd35d091928a48d41d.tar.gz
packages_apps_Browser-570656d8a6505003cb3dc6cd35d091928a48d41d.tar.bz2
Browser: fix crash updating recycled favicon
Occurs on the (slow) galaxysmtd. java.lang.RuntimeException: An error occured while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:300) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355) at java.util.concurrent.FutureTask.setException(FutureTask.java:222) at java.util.concurrent.FutureTask.run(FutureTask.java:242) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:841) Caused by: java.lang.IllegalStateException: Can't compress a recycled bitmap at android.graphics.Bitmap.checkRecycled(Bitmap.java:345) at android.graphics.Bitmap.compress(Bitmap.java:985) at com.android.browser.Bookmarks$1.doInBackground(Bookmarks.java:206) at com.android.browser.Bookmarks$1.doInBackground(Bookmarks.java:202) at android.os.AsyncTask$2.call(AsyncTask.java:288) at java.util.concurrent.FutureTask.run(FutureTask.java:237) ... 4 more Change-Id: I867696996c786024aabb869583583198ac3bc13a
Diffstat (limited to 'src/com/android/browser/Bookmarks.java')
-rw-r--r--src/com/android/browser/Bookmarks.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/browser/Bookmarks.java b/src/com/android/browser/Bookmarks.java
index 190ff9d..0bb4f05 100644
--- a/src/com/android/browser/Bookmarks.java
+++ b/src/com/android/browser/Bookmarks.java
@@ -202,6 +202,12 @@ public class Bookmarks {
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... unused) {
+ if (favicon.isRecycled()) {
+ Log.w(LOGTAG, "Cannot update favicon when Bitmap is already recycled");
+ // just return and update it next time
+ return null;
+ }
+
final ByteArrayOutputStream os = new ByteArrayOutputStream();
favicon.compress(Bitmap.CompressFormat.PNG, 100, os);