use db to mark keys which can certify

This commit is contained in:
Ash Hughes
2013-03-18 18:51:24 +00:00
parent 12d6cfefd7
commit 2d856c5f0e
12 changed files with 57 additions and 7 deletions

View File

@@ -89,7 +89,7 @@ public class SelectSecretKeyFragment extends SherlockListFragment implements
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
// 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.
Uri baseUri = KeyRings.buildPublicKeyRingsUri();
Uri baseUri = KeyRings.buildSecretKeyRingsUri();
// These are the rows that we will retrieve.
long now = new Date().getTime() / 1000;

View File

@@ -151,6 +151,13 @@ public class KeyListAdapter extends CursorTreeAdapter {
masterKeyIcon.setVisibility(View.VISIBLE);
}
ImageView certifyIcon = (ImageView) view.findViewById(R.id.ic_certifyKey);
if (cursor.getInt(cursor.getColumnIndex(Keys.CAN_CERTIFY)) != 1) {
certifyIcon.setVisibility(View.GONE);
} else {
certifyIcon.setVisibility(View.VISIBLE);
}
ImageView encryptIcon = (ImageView) view.findViewById(R.id.ic_encryptKey);
if (cursor.getInt(cursor.getColumnIndex(Keys.CAN_ENCRYPT)) != 1) {
encryptIcon.setVisibility(View.GONE);
@@ -159,7 +166,6 @@ public class KeyListAdapter extends CursorTreeAdapter {
}
ImageView signIcon = (ImageView) view.findViewById(R.id.ic_signKey);
if (cursor.getInt(cursor.getColumnIndex(Keys.CAN_SIGN)) != 1) {
signIcon.setVisibility(View.GONE);
} else {
@@ -213,7 +219,7 @@ public class KeyListAdapter extends CursorTreeAdapter {
switch (type) {
case CHILD_FINGERPRINT:
projection = new String[] { Keys._ID, Keys.KEY_ID, Keys.IS_MASTER_KEY, Keys.ALGORITHM,
Keys.KEY_SIZE, Keys.CAN_SIGN, Keys.CAN_ENCRYPT, };
Keys.KEY_SIZE, Keys.CAN_CERTIFY, Keys.CAN_SIGN, Keys.CAN_ENCRYPT, };
sortOrder = Keys.RANK + " ASC";
// use only master key for fingerprint
@@ -228,7 +234,7 @@ public class KeyListAdapter extends CursorTreeAdapter {
case CHILD_KEY:
projection = new String[] { Keys._ID, Keys.KEY_ID, Keys.IS_MASTER_KEY, Keys.ALGORITHM,
Keys.KEY_SIZE, Keys.CAN_SIGN, Keys.CAN_ENCRYPT, };
Keys.KEY_SIZE, Keys.CAN_CERTIFY, Keys.CAN_SIGN, Keys.CAN_ENCRYPT, };
sortOrder = Keys.RANK + " ASC";
if (mKeyType == Id.type.public_key) {

View File

@@ -139,4 +139,4 @@ public class SelectKeyCursorAdapter extends CursorAdapter {
return mInflater.inflate(R.layout.select_key_item, null);
}
}
}