diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2013-01-18 23:51:44 +0100 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2013-01-18 23:51:44 +0100 |
commit | 4177f7159c96ad964817770e06f3d3727e582684 (patch) | |
tree | b6a05563d16e99258c56de0aeeab19f0e6406f87 /OpenPGP-Keychain-API-Lib | |
parent | d599d26bbd0652532ae667bc81ca812c74299504 (diff) | |
download | open-keychain-4177f7159c96ad964817770e06f3d3727e582684.tar.gz open-keychain-4177f7159c96ad964817770e06f3d3727e582684.tar.bz2 open-keychain-4177f7159c96ad964817770e06f3d3727e582684.zip |
New broadcast on database change to inform other apps
Diffstat (limited to 'OpenPGP-Keychain-API-Lib')
-rw-r--r-- | OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/integration/KeychainContentProviderHelper.java | 13 |
1 files changed, 10 insertions, 3 deletions
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()) { |