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

Commit 7ec683b5 authored by The Android Automerger's avatar The Android Automerger
Browse files

Revert "Clean up CursorWindow code."

This reverts commit 3bc6bbc9.
parent dd8f899a
Loading
Loading
Loading
Loading
+366 −426

File changed.

Preview size limit exceeded, changes collapsed.

+10 −5
Original line number Diff line number Diff line
@@ -18,12 +18,17 @@ package android.database;

/**
 * This exception is thrown when a CursorWindow couldn't be allocated,
 * most probably due to memory not being available.
 *
 * @hide
 * most probably due to memory not being available
 */
public class CursorWindowAllocationException extends RuntimeException {
    public CursorWindowAllocationException(String description) {
class CursorWindowAllocationException extends java.lang.RuntimeException
{
    public CursorWindowAllocationException()
    {
        super();
    }

    public CursorWindowAllocationException(String description)
    {
        super(description);
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ public class SQLiteQuery extends SQLiteProgram {
                // if the start pos is not equal to 0, then most likely window is
                // too small for the data set, loading by another thread
                // is not safe in this situation. the native code will ignore maxRead
                int numRows = native_fill_window(window.mWindowPtr, window.getStartPosition(),
                int numRows = native_fill_window(window, window.getStartPosition(),
                        mOffsetIndex, maxRead, lastPos);
                mDatabase.logTimeStat(mSql, timeStart);
                return numRows;
@@ -154,7 +154,7 @@ public class SQLiteQuery extends SQLiteProgram {
        compileAndbindAllArgs();
    }

    private final native int native_fill_window(int windowPtr,
    private final native int native_fill_window(CursorWindow window,
            int startPos, int offsetParam, int maxRead, int lastPos);

    private final native int native_column_count();
+427 −350

File changed.

Preview size limit exceeded, changes collapsed.

+9 −3
Original line number Diff line number Diff line
@@ -35,6 +35,12 @@

namespace android {

sqlite3_stmt * compile(JNIEnv* env, jobject object,
                       sqlite3 * handle, jstring sqlString);

// From android_database_CursorWindow.cpp
CursorWindow * get_window_from_object(JNIEnv * env, jobject javaWindow);

static jfieldID gHandleField;
static jfieldID gStatementField;

@@ -99,7 +105,7 @@ static int finish_program_and_get_row_count(sqlite3_stmt *statement) {
    return numRows;
}

static jint native_fill_window(JNIEnv* env, jobject object, jint windowPtr,
static jint native_fill_window(JNIEnv* env, jobject object, jobject javaWindow,
                               jint startPos, jint offsetParam, jint maxRead, jint lastPos)
{
    int err;
@@ -136,7 +142,7 @@ static jint native_fill_window(JNIEnv* env, jobject object, jint windowPtr,
    }

    // Get the native window
    window = reinterpret_cast<CursorWindow*>(windowPtr);
    window = get_window_from_object(env, javaWindow);
    if (!window) {
        LOGE("Invalid CursorWindow");
        jniThrowException(env, "java/lang/IllegalArgumentException",
@@ -354,7 +360,7 @@ static jstring native_column_name(JNIEnv* env, jobject object, jint columnIndex)
static JNINativeMethod sMethods[] =
{
     /* name, signature, funcPtr */
    {"native_fill_window", "(IIIII)I",
    {"native_fill_window", "(Landroid/database/CursorWindow;IIII)I",
            (void *)native_fill_window},
    {"native_column_count", "()I", (void*)native_column_count},
    {"native_column_name", "(I)Ljava/lang/String;", (void *)native_column_name},
Loading