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

Commit 2b471744 authored by Dan Sandler's avatar Dan Sandler
Browse files

Defend against missing DB during migration.

Bug: 12600784
Change-Id: Ie295d2ac970eab798b9826748d400cd30a04662d
parent a4db090b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -321,9 +321,11 @@ public class LauncherProvider extends ContentProvider {
    public void deleteDatabase() {
        // Are you sure? (y/n)
        final SQLiteDatabase db = mOpenHelper.getWritableDatabase();
        final String dbFile = db.getPath();
        final File dbFile = new File(db.getPath());
        mOpenHelper.close();
        SQLiteDatabase.deleteDatabase(new File(dbFile));
        if (dbFile.exists()) {
            SQLiteDatabase.deleteDatabase(dbFile);
        }
        mOpenHelper = new DatabaseHelper(getContext());
    }