From 561d1954d552fe1beff6e1ec7d22147935b32c0f Mon Sep 17 00:00:00 2001 From: Mattias Nilsson Date: Tue, 4 Oct 2011 10:18:50 +0200 Subject: Added catch of SQLiteException when updating screenshot Error found when running Monkey test. User probably tries to add a bookmark and directly after deleting it. The method updateScreenshot is running an AsyncTask and gets an Exception from the database when the bookmark does not exist. The deletion of the bookmark runs in another thread. Change-Id: I63bb954419f60fb5106c1a6597692b6bac925714 --- src/com/android/browser/Controller.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java index 7f40aea3..56a9e209 100644 --- a/src/com/android/browser/Controller.java +++ b/src/com/android/browser/Controller.java @@ -35,6 +35,7 @@ import android.content.res.TypedArray; import android.database.ContentObserver; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; +import android.database.sqlite.SQLiteException; import android.graphics.Bitmap; import android.graphics.Canvas; import android.net.Uri; @@ -2138,6 +2139,10 @@ public class Controller } } catch (IllegalStateException e) { // Ignore + } catch (SQLiteException s) { + // Added for possible error when user tries to remove the same bookmark + // that is being updated with a screen shot + Log.w(LOGTAG, "Error when running updateScreenshot ", s); } finally { if (cursor != null) cursor.close(); } -- cgit v1.2.3