Merge "Adding context flag to open database with no localized collators"
diff --git a/api/current.txt b/api/current.txt
index 944d284..8674eef 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -7908,6 +7908,7 @@
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
diff --git a/api/system-current.txt b/api/system-current.txt
index 748fbd9..ef3361b 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -8155,6 +8155,7 @@
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
diff --git a/api/test-current.txt b/api/test-current.txt
index 092684c..2eb4356 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -7908,6 +7908,7 @@
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
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index c661107..23c4198 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -589,6 +589,9 @@
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;
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index b73fa50..6cc5497 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -159,6 +159,16 @@
*/
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 @@
* 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 @@
* @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 @@
* 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 @@
* @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,