From 4177f7159c96ad964817770e06f3d3727e582684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Fri, 18 Jan 2013 23:51:44 +0100 Subject: New broadcast on database change to inform other apps --- .../keychain/integration/KeychainContentProviderHelper.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'OpenPGP-Keychain-API-Lib/src') diff --git a/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/integration/KeychainContentProviderHelper.java b/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/integration/KeychainContentProviderHelper.java index bc2a4ad7a..0b9211748 100644 --- a/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/integration/KeychainContentProviderHelper.java +++ b/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/integration/KeychainContentProviderHelper.java @@ -235,11 +235,18 @@ public class KeychainContentProviderHelper { * @param keyId * @return user id */ - public String getUserId(long keyId) { + public String getUserId(long keyId, boolean secretKeyrings) { String userId = null; try { - Uri contentUri = ContentUris.withAppendedId(CONTENT_URI_SECRET_KEY_RING_BY_KEY_ID, - keyId); + Uri contentUri = null; + if (secretKeyrings) { + contentUri = ContentUris.withAppendedId(CONTENT_URI_SECRET_KEY_RING_BY_KEY_ID, + keyId); + } else { + contentUri = ContentUris.withAppendedId(CONTENT_URI_PUBLIC_KEY_RING_BY_KEY_ID, + keyId); + } + Cursor c = mContext.getContentResolver().query(contentUri, new String[] { "user_id" }, null, null, null); if (c != null && c.moveToFirst()) { -- cgit v1.2.3