From 1a88d834e8f7d21e714121c011fec82369a2e9f1 Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Fri, 7 Feb 2014 09:12:48 -0800 Subject: [PATCH] KeyChain: add explicit package for getPrivateKey Bug: 9964538 Change-Id: If67c1938e9506d4fa81b241bcbce2193d1b194ef --- keystore/java/android/security/KeyChain.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/keystore/java/android/security/KeyChain.java b/keystore/java/android/security/KeyChain.java index 8ad973d4fd02..6f8292d8cf15 100644 --- a/keystore/java/android/security/KeyChain.java +++ b/keystore/java/android/security/KeyChain.java @@ -94,6 +94,11 @@ public final class KeyChain { private static final String ACTION_CHOOSER = "com.android.keychain.CHOOSER"; /** + * Package name for the Certificate Installer. + */ + private static final String CERT_INSTALLER_PACKAGE = "com.android.certinstaller"; + + /** * Extra for use with {@link #ACTION_CHOOSER} * @hide Also used by KeyChainActivity implementation */ @@ -201,7 +206,7 @@ public final class KeyChain { */ public static Intent createInstallIntent() { Intent intent = new Intent(ACTION_INSTALL); - intent.setClassName("com.android.certinstaller", + intent.setClassName(CERT_INSTALLER_PACKAGE, "com.android.certinstaller.CertInstallerMain"); return intent; } @@ -267,6 +272,7 @@ public final class KeyChain { throw new NullPointerException("response == null"); } Intent intent = new Intent(ACTION_CHOOSER); + intent.setPackage(CERT_INSTALLER_PACKAGE); intent.putExtra(EXTRA_RESPONSE, new AliasResponse(response)); intent.putExtra(EXTRA_HOST, host); intent.putExtra(EXTRA_PORT, port); -- 2.11.0