summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2014-05-08 13:28:39 -0700
committerKenny Root <kroot@google.com>2014-06-12 10:59:40 -0700
commit5aac53173509f394e67acd75b98c4d0731c86f76 (patch)
tree551e3770a94b712114b88c81f3af2082286f9481
parentb256d69334d9141aefb3473d0839c31c9f396741 (diff)
downloadCertInstaller-5aac53173509f394e67acd75b98c4d0731c86f76.tar.gz
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
-rw-r--r--src/com/android/certinstaller/CertInstallerMain.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/certinstaller/CertInstallerMain.java b/src/com/android/certinstaller/CertInstallerMain.java
index 9b10c07..ea6f3e5 100644
--- a/src/com/android/certinstaller/CertInstallerMain.java
+++ b/src/com/android/certinstaller/CertInstallerMain.java
@@ -37,6 +37,8 @@ import libcore.io.IoUtils;
* to the public {@link Credentials#INSTALL_ACTION} intent.
*/
public class CertInstallerMain extends CertFile implements Runnable {
+ 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 CertFile implements Runnable {
* 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);
}