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

Commit 31990cd0 authored by Sameer Thatte's avatar Sameer Thatte Committed by Steve Kondik
Browse files

frameworks/base:

Add check for READ ONLY databases (WAL can be used with R/W DBs only).

CRs-Fixed: 278062

Change-Id: Iadcbd868c1ef47e75bbdf5343868e542353ac9f2
parent 132819a5
Loading
Loading
Loading
Loading
+17 −15
Original line number Diff line number Diff line
@@ -124,6 +124,7 @@ static void dbopen(JNIEnv* env, jobject object, jstring pathString, jint flags)
    }

    // Configure databases to run in WAL mode.
    if(!(flags & OPEN_READONLY)) {
        err = sqlite3_exec(handle,"PRAGMA journal_mode = WAL;",
                           NULL, NULL,&zErrMsg);
        if (SQLITE_OK != err ){
@@ -140,6 +141,7 @@ static void dbopen(JNIEnv* env, jobject object, jstring pathString, jint flags)
           throw_sqlite3_exception(env, handle);
           goto done;
        }
    }

    // The soft heap limit prevents the page cache allocations from growing
    // beyond the given limit, no matter what the max page cache sizes are