From 368c91bd821cdd114025fa41b99f2d42c915b2f5 Mon Sep 17 00:00:00 2001 From: Raj Yengisetty Date: Tue, 17 Mar 2015 10:31:41 -0700 Subject: Trebuchet: protect update path for widgetpreviews db After the update path is called, calling getWritableDatabase always results in a SQLiteReadOnlyDatabaseException. Looks to be a Lollipop bug, protecting the code path till we have a better solution. Change-Id: Ic0487e2d588a341d42e046fb97e8f041622d6450 --- src/com/android/launcher3/WidgetPreviewLoader.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/WidgetPreviewLoader.java b/src/com/android/launcher3/WidgetPreviewLoader.java index d496c1c08..7fcb9f9ad 100644 --- a/src/com/android/launcher3/WidgetPreviewLoader.java +++ b/src/com/android/launcher3/WidgetPreviewLoader.java @@ -378,9 +378,13 @@ public class WidgetPreviewLoader { // Delete everything try { db.delete(CacheDb.TABLE_NAME, null, null); + } catch (SQLiteReadOnlyDatabaseException e) { + // After a DB update subsequent calls to getWritableDatabase seems always result in + // a SQLiteReadOnlyDatabaseException. Protect this code path for the time being to + // prevent FC + return; } catch (SQLiteDiskIOException e) { } catch (SQLiteCantOpenDatabaseException e) { - } catch (SQLiteReadOnlyDatabaseException e) { dumpOpenFiles(); throw e; } -- cgit v1.2.3