Skip to content

Project Update #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Oct 29, 2011
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8fe294e
Adding the .DS_Store file to the ignore list
developernotes Aug 25, 2011
884119f
Adding libandroid_runtime.so and libbinder.so to ease linking
developernotes Aug 25, 2011
38679e8
Changing the SQLite build to allow extension loading
developernotes Aug 25, 2011
95c3059
Adding a build file for ant
developernotes Aug 30, 2011
5be3f35
Build configuration that includes a statically linked version of the …
developernotes Oct 4, 2011
41668d6
Adding updates for the icu project
developernotes Oct 4, 2011
bf9f016
Update gitmodule for the icu project
developernotes Oct 4, 2011
1e3039f
Initial merge of icu build project into the root external build file
developernotes Oct 6, 2011
2796385
Fix to allow cross process cursors to work with sqlcipher
developernotes Oct 21, 2011
ed7d5d2
Updating icu4c submodule back to correct commit and repository
developernotes Oct 25, 2011
608f142
Creating the directories for libcrypto and libssl for install
developernotes Oct 25, 2011
d4ee12b
Removing user specific files for build system
developernotes Oct 25, 2011
c9ad76d
Updating the README with build instructions and formatting
developernotes Oct 25, 2011
b234b5c
Revert "refactored code to use android/database/CursorWindow instead …
sjlombardo Oct 25, 2011
a486208
Revert "refactoed to code to use android/database/CursorWindow instea…
sjlombardo Oct 25, 2011
702b730
bring master inline with gp-cursor following reverts
sjlombardo Oct 25, 2011
878aaff
remove generated files from version control
sjlombardo Oct 25, 2011
79b1890
add bin/ and gen/ to ignore list
sjlombardo Oct 25, 2011
feade3a
Adding Makefile for building project and updating documentation
developernotes Oct 25, 2011
a6f071f
Adjustment to the build instructions
developernotes Oct 25, 2011
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix to allow cross process cursors to work with sqlcipher
  • Loading branch information
developernotes committed Oct 28, 2011
commit 27963857150d6c9adfee1cc2700a0c8aced23f6b
58 changes: 58 additions & 0 deletions src/info/guardianproject/database/CrossProcessCursorWrapper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package info.guardianproject.database;

import android.database.Cursor;
import android.database.CrossProcessCursor;
import android.database.CursorWindow;
import android.database.CursorWrapper;

public class CrossProcessCursorWrapper extends CursorWrapper implements CrossProcessCursor {

public CrossProcessCursorWrapper(Cursor cursor) {
super(cursor);
}

@Override
public CursorWindow getWindow() {
return null;
}

@Override
public void fillWindow(int position, CursorWindow window) {
if (position < 0 || position > getCount()) {
return;
}
window.acquireReference();
try {
moveToPosition(position - 1);
window.clear();
window.setStartPosition(position);
int columnNum = getColumnCount();
window.setNumColumns(columnNum);
while (moveToNext() && window.allocRow()) {
for (int i = 0; i < columnNum; i++) {
String field = getString(i);
if (field != null) {
if (!window.putString(field, getPosition(), i)) {
window.freeLastRow();
break;
}
} else {
if (!window.putNull(getPosition(), i)) {
window.freeLastRow();
break;
}
}
}
}
} catch (IllegalStateException e) {
// simply ignore it
} finally {
window.releaseReference();
}
}

@Override
public boolean onMove(int oldPosition, int newPosition) {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package info.guardianproject.database.sqlcipher;

import info.guardianproject.database.CrossProcessCursorWrapper;
import info.guardianproject.database.DatabaseUtils;
import info.guardianproject.database.SQLException;
import info.guardianproject.database.sqlcipher.SQLiteDebug.DbStats;
Expand Down Expand Up @@ -1418,7 +1419,7 @@ public Cursor rawQueryWithFactory(
}
}
}
return cursor;
return new CrossProcessCursorWrapper(cursor);
}

/**
Expand Down