diff options
author | Hung-ying Tyan <tyanh@google.com> | 2010-10-08 08:20:16 +0800 |
---|---|---|
committer | Hung-ying Tyan <tyanh@google.com> | 2010-10-08 08:21:17 +0800 |
commit | c5e630a004d144ba1d4cd1d37dd98eb70a7ec1d8 (patch) | |
tree | 65c495d05a6c378e0820dfb6f7a58d1d08d98b14 | |
parent | 70f1a3b8a0fcf332e35f87be85ae3a9e37a85e9c (diff) | |
download | frameworks_base-c5e630a004d144ba1d4cd1d37dd98eb70a7ec1d8.zip frameworks_base-c5e630a004d144ba1d4cd1d37dd98eb70a7ec1d8.tar.gz frameworks_base-c5e630a004d144ba1d4cd1d37dd98eb70a7ec1d8.tar.bz2 |
Use explicit intent for installing credentials.
http://b/issue?id=3020049
Change-Id: I429c5b2c9f3b876e6197894a9437952d71d5c472
-rw-r--r-- | keystore/java/android/security/Credentials.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/keystore/java/android/security/Credentials.java b/keystore/java/android/security/Credentials.java index 43042c0b..ef19579 100644 --- a/keystore/java/android/security/Credentials.java +++ b/keystore/java/android/security/Credentials.java @@ -80,9 +80,16 @@ public class Credentials { } } + private Intent createInstallIntent() { + Intent intent = new Intent(INSTALL_ACTION); + intent.setClassName("com.android.certinstaller", + "com.android.certinstaller.CertInstallerMain"); + return intent; + } + public void install(Context context, KeyPair pair) { try { - Intent intent = new Intent(INSTALL_ACTION); + Intent intent = createInstallIntent(); intent.putExtra(PRIVATE_KEY, pair.getPrivate().getEncoded()); intent.putExtra(PUBLIC_KEY, pair.getPublic().getEncoded()); context.startActivity(intent); @@ -93,7 +100,7 @@ public class Credentials { public void install(Context context, String type, byte[] value) { try { - Intent intent = new Intent(INSTALL_ACTION); + Intent intent = createInstallIntent(); intent.putExtra(type, value); context.startActivity(intent); } catch (ActivityNotFoundException e) { @@ -103,7 +110,7 @@ public class Credentials { public void installFromSdCard(Context context) { try { - context.startActivity(new Intent(INSTALL_ACTION)); + context.startActivity(createInstallIntent()); } catch (ActivityNotFoundException e) { Log.w(LOGTAG, e.toString()); } |