Add SQLite to libandroid_runtime for linux host
This allows the possibility to use it with Layoutlib/Helium.
Test: lunch sdk && m libandroid_runtime
Change-Id: I93b1ebec968566aeb9209da607ce8a80489ed060
diff --git a/core/jni/Android.bp b/core/jni/Android.bp
index 1123f20..2acfebb 100644
--- a/core/jni/Android.bp
+++ b/core/jni/Android.bp
@@ -303,6 +303,11 @@
linux_glibc: {
srcs: [
"android_content_res_ApkAssets.cpp",
+ "android_database_CursorWindow.cpp",
+ "android_database_SQLiteCommon.cpp",
+ "android_database_SQLiteConnection.cpp",
+ "android_database_SQLiteGlobal.cpp",
+ "android_database_SQLiteDebug.cpp",
"android_hardware_input_InputApplicationHandle.cpp",
"android_os_MessageQueue.cpp",
"android_os_Parcel.cpp",
@@ -326,6 +331,7 @@
static_libs: [
"libinput",
"libbinderthreadstateutils",
+ "libsqlite",
],
shared_libs: [
// libbinder needs to be shared since it has global state
diff --git a/core/jni/LayoutlibLoader.cpp b/core/jni/LayoutlibLoader.cpp
index 4e50f87..3e513df 100644
--- a/core/jni/LayoutlibLoader.cpp
+++ b/core/jni/LayoutlibLoader.cpp
@@ -41,6 +41,10 @@
extern int register_android_content_StringBlock(JNIEnv* env);
extern int register_android_content_XmlBlock(JNIEnv* env);
extern int register_android_content_res_ApkAssets(JNIEnv* env);
+extern int register_android_database_CursorWindow(JNIEnv* env);
+extern int register_android_database_SQLiteConnection(JNIEnv* env);
+extern int register_android_database_SQLiteGlobal(JNIEnv* env);
+extern int register_android_database_SQLiteDebug(JNIEnv* env);
extern int register_android_os_FileObserver(JNIEnv* env);
extern int register_android_os_MessageQueue(JNIEnv* env);
extern int register_android_os_SystemClock(JNIEnv* env);
@@ -65,6 +69,11 @@
#ifdef __linux__
{"android.content.res.ApkAssets", REG_JNI(register_android_content_res_ApkAssets)},
{"android.content.res.AssetManager", REG_JNI(register_android_content_AssetManager)},
+ {"android.database.CursorWindow", REG_JNI(register_android_database_CursorWindow)},
+ {"android.database.sqlite.SQLiteConnection",
+ REG_JNI(register_android_database_SQLiteConnection)},
+ {"android.database.sqlite.SQLiteGlobal", REG_JNI(register_android_database_SQLiteGlobal)},
+ {"android.database.sqlite.SQLiteDebug", REG_JNI(register_android_database_SQLiteDebug)},
#endif
{"android.content.res.StringBlock", REG_JNI(register_android_content_StringBlock)},
{"android.content.res.XmlBlock", REG_JNI(register_android_content_XmlBlock)},
diff --git a/libs/androidfw/Android.bp b/libs/androidfw/Android.bp
index 903ca2a..97ec59e 100644
--- a/libs/androidfw/Android.bp
+++ b/libs/androidfw/Android.bp
@@ -96,6 +96,11 @@
"libz",
],
},
+ linux_glibc: {
+ srcs: [
+ "CursorWindow.cpp",
+ ],
+ },
windows: {
enabled: true,
},