aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/provider
diff options
context:
space:
mode:
Diffstat (limited to 'OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/provider')
-rw-r--r--OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java
index bcea66498..e9179f864 100644
--- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java
+++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java
@@ -43,8 +43,8 @@ import org.sufficientlysecure.keychain.pgp.PgpConversionHelper;
import org.sufficientlysecure.keychain.pgp.PgpHelper;
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
import org.sufficientlysecure.keychain.provider.KeychainContract.ApiApps;
-import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRingData;
+import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
import org.sufficientlysecure.keychain.provider.KeychainContract.Keys;
import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds;
import org.sufficientlysecure.keychain.provider.KeychainContract.Certs;
@@ -77,6 +77,7 @@ public class ProviderHelper {
public static Object getGenericData(Context context, Uri uri, String column, int type) {
return getGenericData(context, uri, new String[] { column }, new int[] { type }).get(column);
}
+
public static HashMap<String,Object> getGenericData(Context context, Uri uri, String[] proj, int[] types) {
Cursor cursor = context.getContentResolver().query(uri, proj, null, null, null);
@@ -105,10 +106,15 @@ public class ProviderHelper {
public static Object getUnifiedData(Context context, long masterKeyId, String column, int type) {
return getUnifiedData(context, masterKeyId, new String[] { column }, new int[] { type }).get(column);
}
+
public static HashMap<String,Object> getUnifiedData(Context context, long masterKeyId, String[] proj, int[] types) {
return getGenericData(context, KeyRings.buildUnifiedKeyRingUri(Long.toString(masterKeyId)), proj, types);
}
+ /**
+ * Find the master key id related to a given query. The id will either be extracted from the
+ * query, which should work for all specific /key_rings/ queries, or will be queried if it can't.
+ */
public static long getMasterKeyId(Context context, Uri queryUri) {
// try extracting from the uri first
String firstSegment = queryUri.getPathSegments().get(1);
@@ -504,6 +510,7 @@ public class ProviderHelper {
return null;
}
}
+
private static Cursor getCursorWithSelectedKeyringMasterKeyIds(Context context, long[] masterKeyIds) {
Cursor cursor = null;
if (masterKeyIds != null && masterKeyIds.length > 0) {