mirror of
https://github.com/moparisthebest/open-keychain
synced 2025-02-23 14:41:54 -05:00
add linked id certs uri to KeychainProvider
This commit is contained in:
parent
138773798a
commit
159b197930
@ -359,8 +359,8 @@ public class KeychainContract {
|
|||||||
.appendPath(PATH_CERTS).build();
|
.appendPath(PATH_CERTS).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Uri buildLinkedIdCertsUri(long masterKeyId, int rank) {
|
public static Uri buildLinkedIdCertsUri(Uri uri, int rank) {
|
||||||
return CONTENT_URI.buildUpon().appendPath(Long.toString(masterKeyId))
|
return CONTENT_URI.buildUpon().appendPath(uri.getPathSegments().get(1))
|
||||||
.appendPath(PATH_LINKED_IDS).appendPath(Integer.toString(rank))
|
.appendPath(PATH_LINKED_IDS).appendPath(Integer.toString(rank))
|
||||||
.appendPath(PATH_CERTS).build();
|
.appendPath(PATH_CERTS).build();
|
||||||
}
|
}
|
||||||
|
@ -566,7 +566,8 @@ public class KeychainProvider extends ContentProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case KEY_RING_CERTS:
|
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<>();
|
HashMap<String, String> projectionMap = new HashMap<>();
|
||||||
projectionMap.put(Certs._ID, Tables.CERTS + ".oid AS " + Certs._ID);
|
projectionMap.put(Certs._ID, Tables.CERTS + ".oid AS " + Certs._ID);
|
||||||
projectionMap.put(Certs.MASTER_KEY_ID, Tables.CERTS + "." + Certs.MASTER_KEY_ID);
|
projectionMap.put(Certs.MASTER_KEY_ID, Tables.CERTS + "." + Certs.MASTER_KEY_ID);
|
||||||
@ -587,10 +588,6 @@ public class KeychainProvider extends ContentProvider {
|
|||||||
+ " AND "
|
+ " AND "
|
||||||
+ Tables.CERTS + "." + Certs.RANK + " = "
|
+ Tables.CERTS + "." + Certs.RANK + " = "
|
||||||
+ Tables.USER_PACKETS + "." + UserPackets.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 ("
|
+ ") LEFT JOIN " + Tables.USER_PACKETS + " AS signer ON ("
|
||||||
+ Tables.CERTS + "." + Certs.KEY_ID_CERTIFIER + " = "
|
+ Tables.CERTS + "." + Certs.KEY_ID_CERTIFIER + " = "
|
||||||
+ "signer." + UserPackets.MASTER_KEY_ID
|
+ "signer." + UserPackets.MASTER_KEY_ID
|
||||||
@ -610,6 +607,17 @@ public class KeychainProvider extends ContentProvider {
|
|||||||
qb.appendWhereEscapeString(uri.getPathSegments().get(4));
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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>
|
|
Loading…
x
Reference in New Issue
Block a user