summaryrefslogtreecommitdiffstats
path: root/core/jni
diff options
context:
space:
mode:
authorVasu Nori <vnori@google.com>2010-06-03 11:46:03 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-06-03 11:46:03 -0700
commitac7ae9cc9118ad8e75011b7c94f05545f2cbe0e8 (patch)
treee317f4ae43341694edffc0b27bb9e9c9060d6da0 /core/jni
parente4c8aa60e3b62e8e05e2ec935ca785da2aa1e727 (diff)
parent8b0dd7da360d70920a37802eb455ba41500d3b45 (diff)
downloadframeworks_base-ac7ae9cc9118ad8e75011b7c94f05545f2cbe0e8.zip
frameworks_base-ac7ae9cc9118ad8e75011b7c94f05545f2cbe0e8.tar.gz
frameworks_base-ac7ae9cc9118ad8e75011b7c94f05545f2cbe0e8.tar.bz2
Merge "add API to Cursor to get column value type"
Diffstat (limited to 'core/jni')
-rw-r--r--core/jni/android_database_CursorWindow.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/jni/android_database_CursorWindow.cpp b/core/jni/android_database_CursorWindow.cpp
index fba6f0f..55f5252 100644
--- a/core/jni/android_database_CursorWindow.cpp
+++ b/core/jni/android_database_CursorWindow.cpp
@@ -652,6 +652,22 @@ static void freeLastRow(JNIEnv * env, jobject object) {
window->freeLastRow();
}
+static jint getType_native(JNIEnv* env, jobject object, jint row, jint column)
+{
+ int32_t err;
+ CursorWindow * window = GET_WINDOW(env, object);
+ LOG_WINDOW("returning column type affinity for %d,%d from %p", row, column, window);
+
+ field_slot_t field;
+ err = window->read_field_slot(row, column, &field);
+ if (err != 0) {
+ throwExceptionWithRowCol(env, row, column);
+ return NULL;
+ }
+
+ return field.type;
+}
+
static JNINativeMethod sMethods[] =
{
/* name, signature, funcPtr */
@@ -679,6 +695,7 @@ static JNINativeMethod sMethods[] =
{"isString_native", "(II)Z", (void *)isString_native},
{"isFloat_native", "(II)Z", (void *)isFloat_native},
{"isInteger_native", "(II)Z", (void *)isInteger_native},
+ {"getType_native", "(II)I", (void *)getType_native},
};
int register_android_database_CursorWindow(JNIEnv * env)