mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-11 03:25:05 -05:00
fix unified query columns for select*fragment
This commit is contained in:
parent
b1cd669f14
commit
dd8a7c93ad
@ -109,7 +109,7 @@ public class KeychainContract {
|
||||
public static final String VERIFIED = CertsColumns.VERIFIED;
|
||||
public static final String HAS_ANY_SECRET = "has_any_secret";
|
||||
public static final String HAS_ENCRYPT = "has_encrypt";
|
||||
public static final String HAS_SIGN = "has_encrypt";
|
||||
public static final String HAS_SIGN = "has_sign";
|
||||
|
||||
public static final Uri CONTENT_URI = BASE_CONTENT_URI_INTERNAL.buildUpon()
|
||||
.appendPath(BASE_KEY_RINGS).build();
|
||||
|
@ -261,24 +261,23 @@ public class KeychainProvider extends ContentProvider {
|
||||
+ " = " + Tables.KEYS + "." + Keys.MASTER_KEY_ID
|
||||
+ ")) AS " + KeyRings.HAS_ANY_SECRET);
|
||||
projectionMap.put(KeyRings.HAS_ENCRYPT,
|
||||
"(EXISTS (SELECT COUNT(*) FROM " + Tables.KEYS + " AS k"
|
||||
"(EXISTS (SELECT * FROM " + Tables.KEYS + " AS k"
|
||||
+" WHERE k." + Keys.MASTER_KEY_ID
|
||||
+ " = " + Tables.KEYS + "." + Keys.MASTER_KEY_ID
|
||||
+ " AND k." + Keys.IS_REVOKED + " = 0"
|
||||
+ " AND k." + Keys.HAS_SECRET + " = 1"
|
||||
+ " AND k." + Keys.CAN_ENCRYPT + " = 1"
|
||||
+ " AND ( k." + Keys.EXPIRY + " IS NULL OR k." + Keys.EXPIRY
|
||||
+ " >= '" + new Date().getTime() / 1000 + "' )"
|
||||
+ " >= " + new Date().getTime() / 1000 + " )"
|
||||
+ ")) AS " + KeyRings.HAS_ENCRYPT);
|
||||
projectionMap.put(KeyRings.HAS_SIGN,
|
||||
"(EXISTS (SELECT COUNT(*) FROM " + Tables.KEYS + " AS k"
|
||||
"(EXISTS (SELECT * FROM " + Tables.KEYS + " AS k"
|
||||
+" WHERE k." + Keys.MASTER_KEY_ID
|
||||
+ " = " + Tables.KEYS + "." + Keys.MASTER_KEY_ID
|
||||
+ " AND k." + Keys.IS_REVOKED + " = 0"
|
||||
+ " AND k." + Keys.HAS_SECRET + " = 1"
|
||||
+ " AND k." + Keys.CAN_SIGN + " = 1"
|
||||
+ " AND ( k." + Keys.EXPIRY + " IS NULL OR k." + Keys.EXPIRY
|
||||
+ " >= '" + new Date().getTime() / 1000 + "' )"
|
||||
+ " >= " + new Date().getTime() / 1000 + " )"
|
||||
+ ")) AS " + KeyRings.HAS_SIGN);
|
||||
qb.setProjectionMap(projectionMap);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user