summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeff Brown <jeffbrown@google.com> 2011-10-07 13:15:59 -0700
committer Jeff Brown <jeffbrown@google.com> 2011-10-07 13:17:18 -0700
commitaa32c30b81134fc7ebd9408f4757d1dc4410f338 (patch)
tree4b3df25c2505cc99265fe7d2277876d09be7f438
parent3bc6bbc92cd2095f42039b5aadd0a14d0e5d9230 (diff)
Restore broken CursorWindow.getType behavior.
Bug: 5430009 Some CTS tests try to call getType on fields in empty cursor windows or with out of bound column indices (-1). Restoring the previous behavior of returning FIELD_TYPE_NULL instead of throwing. Fix this later. Change-Id: I782bd02012474e7dabc5bb7ea2dc45e8b0c7ef25
-rw-r--r--core/jni/android_database_CursorWindow.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/jni/android_database_CursorWindow.cpp b/core/jni/android_database_CursorWindow.cpp
index 14c6397db8c4..9ff2cb279101 100644
--- a/core/jni/android_database_CursorWindow.cpp
+++ b/core/jni/android_database_CursorWindow.cpp
@@ -147,8 +147,10 @@ static jint nativeGetType(JNIEnv* env, jclass clazz, jint windowPtr,
field_slot_t* fieldSlot = window->getFieldSlotWithCheck(row, column);
if (!fieldSlot) {
- throwExceptionWithRowCol(env, row, column);
- return NULL;
+ // FIXME: This is really broken but we have CTS tests that depend
+ // on this legacy behavior.
+ //throwExceptionWithRowCol(env, row, column);
+ return FIELD_TYPE_NULL;
}
return fieldSlot->type;
}