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

Commit a21e6b2f authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Adding context flag to open database with no localized collators

Bug: 25956606
Change-Id: I209a8d18a7e83c1af54309fae8607f8b46772196
parent e03d5e49
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -7908,6 +7908,7 @@ package android.content {
    field public static final int MODE_APPEND = 32768; // 0x8000
    field public static final int MODE_ENABLE_WRITE_AHEAD_LOGGING = 8; // 0x8
    field public static final deprecated int MODE_MULTI_PROCESS = 4; // 0x4
    field public static final int MODE_NO_LOCALIZED_COLLATORS = 16; // 0x10
    field public static final int MODE_PRIVATE = 0; // 0x0
    field public static final deprecated int MODE_WORLD_READABLE = 1; // 0x1
    field public static final deprecated int MODE_WORLD_WRITEABLE = 2; // 0x2
+1 −0
Original line number Diff line number Diff line
@@ -8155,6 +8155,7 @@ package android.content {
    field public static final int MODE_APPEND = 32768; // 0x8000
    field public static final int MODE_ENABLE_WRITE_AHEAD_LOGGING = 8; // 0x8
    field public static final deprecated int MODE_MULTI_PROCESS = 4; // 0x4
    field public static final int MODE_NO_LOCALIZED_COLLATORS = 16; // 0x10
    field public static final int MODE_PRIVATE = 0; // 0x0
    field public static final deprecated int MODE_WORLD_READABLE = 1; // 0x1
    field public static final deprecated int MODE_WORLD_WRITEABLE = 2; // 0x2
+1 −0
Original line number Diff line number Diff line
@@ -7908,6 +7908,7 @@ package android.content {
    field public static final int MODE_APPEND = 32768; // 0x8000
    field public static final int MODE_ENABLE_WRITE_AHEAD_LOGGING = 8; // 0x8
    field public static final deprecated int MODE_MULTI_PROCESS = 4; // 0x4
    field public static final int MODE_NO_LOCALIZED_COLLATORS = 16; // 0x10
    field public static final int MODE_PRIVATE = 0; // 0x0
    field public static final deprecated int MODE_WORLD_READABLE = 1; // 0x1
    field public static final deprecated int MODE_WORLD_WRITEABLE = 2; // 0x2
+3 −0
Original line number Diff line number Diff line
@@ -589,6 +589,9 @@ class ContextImpl extends Context {
        if ((mode & MODE_ENABLE_WRITE_AHEAD_LOGGING) != 0) {
            flags |= SQLiteDatabase.ENABLE_WRITE_AHEAD_LOGGING;
        }
        if ((mode & MODE_NO_LOCALIZED_COLLATORS) != 0) {
            flags |= SQLiteDatabase.NO_LOCALIZED_COLLATORS;
        }
        SQLiteDatabase db = SQLiteDatabase.openDatabase(f.getPath(), factory, flags, errorHandler);
        setFilePermissionsFromMode(f.getPath(), mode, 0);
        return db;
+14 −0
Original line number Diff line number Diff line
@@ -159,6 +159,16 @@ public abstract class Context {
     */
    public static final int MODE_ENABLE_WRITE_AHEAD_LOGGING = 0x0008;

    /**
     * Database open flag: when set, the database is opened without support for
     * localized collators.
     *
     * @see #openOrCreateDatabase(String, int, CursorFactory)
     * @see #openOrCreateDatabase(String, int, CursorFactory, DatabaseErrorHandler)
     * @see SQLiteDatabase#NO_LOCALIZED_COLLATORS
     */
    public static final int MODE_NO_LOCALIZED_COLLATORS = 0x0010;

    /** @hide */
    @IntDef(flag = true,
            value = {
@@ -1271,6 +1281,7 @@ public abstract class Context {
     *     default operation, {@link #MODE_WORLD_READABLE}
     *     and {@link #MODE_WORLD_WRITEABLE} to control permissions.
     *     Use {@link #MODE_ENABLE_WRITE_AHEAD_LOGGING} to enable write-ahead logging by default.
     *     Use {@link #MODE_NO_LOCALIZED_COLLATORS} to disable localized collators.
     * @param factory An optional factory class that is called to instantiate a
     *     cursor when query is called.
     *
@@ -1281,6 +1292,7 @@ public abstract class Context {
     * @see #MODE_WORLD_READABLE
     * @see #MODE_WORLD_WRITEABLE
     * @see #MODE_ENABLE_WRITE_AHEAD_LOGGING
     * @see #MODE_NO_LOCALIZED_COLLATORS
     * @see #deleteDatabase
     */
    public abstract SQLiteDatabase openOrCreateDatabase(String name,
@@ -1298,6 +1310,7 @@ public abstract class Context {
     *     default operation, {@link #MODE_WORLD_READABLE}
     *     and {@link #MODE_WORLD_WRITEABLE} to control permissions.
     *     Use {@link #MODE_ENABLE_WRITE_AHEAD_LOGGING} to enable write-ahead logging by default.
     *     Use {@link #MODE_NO_LOCALIZED_COLLATORS} to disable localized collators.
     * @param factory An optional factory class that is called to instantiate a
     *     cursor when query is called.
     * @param errorHandler the {@link DatabaseErrorHandler} to be used when sqlite reports database
@@ -1309,6 +1322,7 @@ public abstract class Context {
     * @see #MODE_WORLD_READABLE
     * @see #MODE_WORLD_WRITEABLE
     * @see #MODE_ENABLE_WRITE_AHEAD_LOGGING
     * @see #MODE_NO_LOCALIZED_COLLATORS
     * @see #deleteDatabase
     */
    public abstract SQLiteDatabase openOrCreateDatabase(String name,