From 826b18c410f76e4ab3c361638f7e0ffe6d8ef32e Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Thu, 8 May 2014 13:28:39 -0700 Subject: Check component class instead of action Ensure the called intent was filtered for permission by ActivityManagerService by checking the ComponentName instead of the action. (cherry picked from commit 38a956408f45c9a7cbb48b79c67257b9207fda30) Bug: 14441285 Change-Id: I3a848ef2375ddfa7c9b35389524419993a6b3693 --- src/com/android/certinstaller/CertInstallerMain.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/com/android/certinstaller/CertInstallerMain.java b/src/com/android/certinstaller/CertInstallerMain.java index c83e99f..46ba696 100644 --- a/src/com/android/certinstaller/CertInstallerMain.java +++ b/src/com/android/certinstaller/CertInstallerMain.java @@ -51,6 +51,8 @@ public class CertInstallerMain extends PreferenceActivity { "application/pkix-cert" }; + private static final String INSTALL_CERT_AS_USER_CLASS = ".InstallCertAsUser"; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -70,7 +72,9 @@ public class CertInstallerMain extends PreferenceActivity { * caller got here any other way, remove the extra that we allow in * that INSTALL_AS_USER path. */ - if (bundle != null && !Credentials.INSTALL_AS_USER_ACTION.equals(action)) { + String calledClass = intent.getComponent().getClassName(); + String installAsUserClassName = getPackageName() + INSTALL_CERT_AS_USER_CLASS; + if (bundle != null && !installAsUserClassName.equals(calledClass)) { bundle.remove(Credentials.EXTRA_INSTALL_AS_UID); } -- cgit v1.2.3