Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 368c91bd authored by Raj Yengisetty's avatar Raj Yengisetty Committed by Matt Garnes
Browse files

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
parent 5482c2f4
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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;
        }