aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'OpenKeychain/src/main')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainContract.java4
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainProvider.java18
-rw-r--r--OpenKeychain/src/main/res/layout/linked_id_cert.xml52
3 files changed, 15 insertions, 59 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainContract.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainContract.java
index 08f3b5248..0a7cf4a41 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainContract.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainContract.java
@@ -359,8 +359,8 @@ public class KeychainContract {
.appendPath(PATH_CERTS).build();
}
- public static Uri buildLinkedIdCertsUri(long masterKeyId, int rank) {
- return CONTENT_URI.buildUpon().appendPath(Long.toString(masterKeyId))
+ public static Uri buildLinkedIdCertsUri(Uri uri, int rank) {
+ return CONTENT_URI.buildUpon().appendPath(uri.getPathSegments().get(1))
.appendPath(PATH_LINKED_IDS).appendPath(Integer.toString(rank))
.appendPath(PATH_CERTS).build();
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainProvider.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainProvider.java
index 0f42b3934..19634bed8 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainProvider.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainProvider.java
@@ -566,7 +566,8 @@ public class KeychainProvider extends ContentProvider {
}
case KEY_RING_CERTS:
- case KEY_RING_CERTS_SPECIFIC: {
+ case KEY_RING_CERTS_SPECIFIC:
+ case KEY_RING_LINKED_ID_CERTS: {
HashMap<String, String> projectionMap = new HashMap<>();
projectionMap.put(Certs._ID, Tables.CERTS + ".oid AS " + Certs._ID);
projectionMap.put(Certs.MASTER_KEY_ID, Tables.CERTS + "." + Certs.MASTER_KEY_ID);
@@ -587,10 +588,6 @@ public class KeychainProvider extends ContentProvider {
+ " AND "
+ Tables.CERTS + "." + Certs.RANK + " = "
+ Tables.USER_PACKETS + "." + UserPackets.RANK
- // for now, we only return user ids here, so TYPE must be NULL
- // TODO at some point, we should lift this restriction
- + " AND "
- + Tables.USER_PACKETS + "." + UserPackets.TYPE + " IS NULL"
+ ") LEFT JOIN " + Tables.USER_PACKETS + " AS signer ON ("
+ Tables.CERTS + "." + Certs.KEY_ID_CERTIFIER + " = "
+ "signer." + UserPackets.MASTER_KEY_ID
@@ -610,6 +607,17 @@ public class KeychainProvider extends ContentProvider {
qb.appendWhereEscapeString(uri.getPathSegments().get(4));
}
+ if (match == KEY_RING_LINKED_ID_CERTS) {
+ qb.appendWhere(" AND " + Tables.USER_PACKETS + "."
+ + UserPackets.TYPE + " IS NOT NULL");
+
+ qb.appendWhere(" AND " + Tables.USER_PACKETS + "."
+ + UserPackets.RANK + " = ");
+ qb.appendWhereEscapeString(uri.getPathSegments().get(3));
+ } else {
+ qb.appendWhere(" AND " + Tables.USER_PACKETS + "." + UserPackets.TYPE + " IS NULL");
+ }
+
break;
}
diff --git a/OpenKeychain/src/main/res/layout/linked_id_cert.xml b/OpenKeychain/src/main/res/layout/linked_id_cert.xml
deleted file mode 100644
index b2b841ffc..000000000
--- a/OpenKeychain/src/main/res/layout/linked_id_cert.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:minHeight="?android:attr/listPreferredItemHeight"
- android:orientation="horizontal"
- android:singleLine="true">
-
- <LinearLayout
- android:orientation="vertical"
- android:layout_gravity="center_vertical"
- android:layout_width="0dip"
- android:layout_marginLeft="16dp"
- android:layout_marginTop="4dp"
- android:layout_marginBottom="4dp"
- android:layout_height="wrap_content"
- android:layout_weight="1">
-
- <TextView
- android:id="@+id/linked_cert_text"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Verifying…"
- android:textAppearance="?android:attr/textAppearanceMedium" />
-
- </LinearLayout>
-
- <ViewAnimator
- android:layout_width="22dp"
- android:layout_height="22dp"
- android:layout_marginLeft="16dp"
- android:layout_marginRight="16dp"
- android:layout_gravity="center"
- android:id="@+id/linked_cert_progress"
- android:inAnimation="@anim/fade_in"
- android:outAnimation="@anim/fade_out">
-
- <ProgressBar
- android:layout_width="22dp"
- android:layout_height="22dp"
- android:indeterminate="true"
- />
-
- <ImageView
- android:layout_width="22dp"
- android:layout_height="wrap_content"
- android:src="@drawable/status_signature_unknown_cutout_24dp"
- android:id="@+id/linked_cert_icon"
- />
- </ViewAnimator>
-
-</LinearLayout>