summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdnan Begovic <adnan@cyngn.com>2015-02-10 22:00:16 (GMT)
committerAdnan Begovic <adnan@cyngn.com>2015-02-10 22:00:16 (GMT)
commit2ac97c4cb8baff1f58f46e440044a03eee6be774 (patch)
tree49937e47b304d64e4f402740d1eab9aa3382845e
parent1fcd6e3a5e32db272381c57153773b0b7f47494a (diff)
downloadandroid_packages_apps_Trebuchet-2ac97c4cb8baff1f58f46e440044a03eee6be774.zip
android_packages_apps_Trebuchet-2ac97c4cb8baff1f58f46e440044a03eee6be774.tar.gz
android_packages_apps_Trebuchet-2ac97c4cb8baff1f58f46e440044a03eee6be774.tar.bz2
Trebuchet: Catch SQLiteReadOnlyException.
BUGDUMP-648580 android.database.sqlite.SQLiteReadOnlyDatabaseException: attempt to write a readonly database (code 1032) at android.database.sqlite.SQLiteConnection.nativeExecuteForChangedRowCount(Native Method) at android.database.sqlite.SQLiteConnection.executeForChangedRowCount(SQLiteConnection.java:736) at android.database.sqlite.SQLiteSession.executeForChangedRowCount(SQLiteSession.java:754) at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:64) at android.database.sqlite.SQLiteDatabase.delete(SQLiteDatabase.java:1499) at com.android.launcher3.WidgetPreviewLoader.clearDb(WidgetPreviewLoader.java:379) ... Change-Id: I5e3cbd85a2fba84263b1e6df25f00f98b1ef55c0
-rw-r--r--src/com/android/launcher3/WidgetPreviewLoader.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/com/android/launcher3/WidgetPreviewLoader.java b/src/com/android/launcher3/WidgetPreviewLoader.java
index 5aa7190..d496c1c 100644
--- a/src/com/android/launcher3/WidgetPreviewLoader.java
+++ b/src/com/android/launcher3/WidgetPreviewLoader.java
@@ -12,6 +12,7 @@ import android.database.sqlite.SQLiteCantOpenDatabaseException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDiskIOException;
import android.database.sqlite.SQLiteOpenHelper;
+import android.database.sqlite.SQLiteReadOnlyDatabaseException;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.BitmapFactory;
@@ -379,6 +380,7 @@ public class WidgetPreviewLoader {
db.delete(CacheDb.TABLE_NAME, null, null);
} catch (SQLiteDiskIOException e) {
} catch (SQLiteCantOpenDatabaseException e) {
+ } catch (SQLiteReadOnlyDatabaseException e) {
dumpOpenFiles();
throw e;
}