do not delete pub keys where secret key exists

This commit is contained in:
Dominik Schürmann
2014-02-06 01:02:18 +01:00
parent a41228fc06
commit 616c903a2a
6 changed files with 195 additions and 51 deletions

View File

@@ -564,6 +564,26 @@ public class ProviderHelper {
return fingerprint;
}
public static String getUserId(Context context, Uri queryUri) {
String[] projection = new String[]{UserIds.USER_ID};
Cursor cursor = context.getContentResolver().query(queryUri, projection, null, null, null);
String userId = null;
try {
if (cursor != null && cursor.moveToFirst()) {
int col = cursor.getColumnIndexOrThrow(UserIds.USER_ID);
userId = cursor.getString(col);
}
} finally {
if (cursor != null) {
cursor.close();
}
}
return userId;
}
public static ArrayList<String> getKeyRingsAsArmoredString(Context context, Uri uri,
long[] masterKeyIds) {
ArrayList<String> output = new ArrayList<String>();