Fixed bug in secret key selection fragment where it was displaying public keys

This commit is contained in:
Michael Dietz 2013-02-26 12:01:27 -06:00
parent 99122fa8d9
commit ed0d7e1a53

View File

@ -20,6 +20,7 @@ package org.sufficientlysecure.keychain.ui;
import java.util.Date; import java.util.Date;
import org.sufficientlysecure.keychain.Id; import org.sufficientlysecure.keychain.Id;
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyTypes;
import org.sufficientlysecure.keychain.provider.KeychainDatabase; import org.sufficientlysecure.keychain.provider.KeychainDatabase;
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings; import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
import org.sufficientlysecure.keychain.provider.KeychainContract.Keys; import org.sufficientlysecure.keychain.provider.KeychainContract.Keys;
@ -89,7 +90,7 @@ public class SelectSecretKeyFragment extends SherlockListFragment implements
public Loader<Cursor> onCreateLoader(int id, Bundle args) { public Loader<Cursor> onCreateLoader(int id, Bundle args) {
// This is called when a new Loader needs to be created. This // This is called when a new Loader needs to be created. This
// sample only has one Loader, so we don't care about the ID. // sample only has one Loader, so we don't care about the ID.
Uri baseUri = KeyRings.buildPublicKeyRingsUri(); Uri baseUri = KeyRings.buildSecretKeyRingsUri();
// These are the rows that we will retrieve. // These are the rows that we will retrieve.
long now = new Date().getTime() / 1000; long now = new Date().getTime() / 1000;
@ -111,6 +112,8 @@ public class SelectSecretKeyFragment extends SherlockListFragment implements
+ "(valid_keys." + Keys.EXPIRY + " IS NULL OR valid_keys." + Keys.EXPIRY + "(valid_keys." + Keys.EXPIRY + " IS NULL OR valid_keys." + Keys.EXPIRY
+ " >= '" + now + "')) AS " + SelectKeyCursorAdapter.PROJECTION_ROW_VALID, }; + " >= '" + now + "')) AS " + SelectKeyCursorAdapter.PROJECTION_ROW_VALID, };
System.out.println(projection);
// if (searchString != null && searchString.trim().length() > 0) { // if (searchString != null && searchString.trim().length() > 0) {
// String[] chunks = searchString.trim().split(" +"); // String[] chunks = searchString.trim().split(" +");
// qb.appendWhere("EXISTS (SELECT tmp." + UserIds._ID + " FROM " + UserIds.TABLE_NAME // qb.appendWhere("EXISTS (SELECT tmp." + UserIds._ID + " FROM " + UserIds.TABLE_NAME