summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorAdnan Begovic <adnan@cyngn.com>2016-05-18 14:12:12 -0700
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-05-19 10:46:27 -0700
commitb7583ae4c856162aeac18f4169cfa1d06aa641a8 (patch)
treea9214f3827da9ccad3ebafa29f102a78ffa0ebd6 /core
parent2da425ef6547df98e2c912fa42f295e83359ffaf (diff)
downloadframeworks_base-b7583ae4c856162aeac18f4169cfa1d06aa641a8.zip
frameworks_base-b7583ae4c856162aeac18f4169cfa1d06aa641a8.tar.gz
frameworks_base-b7583ae4c856162aeac18f4169cfa1d06aa641a8.tar.bz2
am: Handle unchecked activity starts for protected components.
Previously if you received a notification from a protected app, since AM would state that the calling package was also the target package, the protected apps implementation would allow you to launch into the application. Mitigate this by hooking into the unchecked activity start stack (pending intent launches) globally. Change-Id: I0371593ade9e4af2554962873d89a0f82a639b57 TICKET: PAELLA-216 FEIJ-160 FEIJ-177
Diffstat (limited to 'core')
-rw-r--r--core/java/android/app/ApplicationPackageManager.java6
-rw-r--r--core/java/android/content/pm/IPackageManager.aidl4
-rw-r--r--core/java/android/content/pm/PackageManager.java2
3 files changed, 7 insertions, 5 deletions
diff --git a/core/java/android/app/ApplicationPackageManager.java b/core/java/android/app/ApplicationPackageManager.java
index db4e123..c829daa 100644
--- a/core/java/android/app/ApplicationPackageManager.java
+++ b/core/java/android/app/ApplicationPackageManager.java
@@ -2048,9 +2048,11 @@ final class ApplicationPackageManager extends PackageManager {
/** @hide */
@Override
- public boolean isComponentProtected(String callingPackage, ComponentName componentName) {
+ public boolean isComponentProtected(String callingPackage, int callingUid,
+ ComponentName componentName) {
try {
- return mPM.isComponentProtected(callingPackage, componentName, mContext.getUserId());
+ return mPM.isComponentProtected(callingPackage, callingUid, componentName,
+ mContext.getUserId());
} catch (RemoteException re) {
Log.e(TAG, "Failed to get component protected setting", re);
return false;
diff --git a/core/java/android/content/pm/IPackageManager.aidl b/core/java/android/content/pm/IPackageManager.aidl
index 6d8b5cb..a3329db 100644
--- a/core/java/android/content/pm/IPackageManager.aidl
+++ b/core/java/android/content/pm/IPackageManager.aidl
@@ -521,6 +521,6 @@ interface IPackageManager {
int processThemeResources(String themePkgName);
/** Protected Apps */
- boolean isComponentProtected(in String callingPackage, in ComponentName componentName,
- int userId);
+ boolean isComponentProtected(in String callingPackage, in int callingUid,
+ in ComponentName componentName, int userId);
}
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index 529d641..8f0500e 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -4564,7 +4564,7 @@ public abstract class PackageManager {
* Return whether or not a specific component is protected
* @hide
*/
- public abstract boolean isComponentProtected(String callingPackage,
+ public abstract boolean isComponentProtected(String callingPackage, int callingUid,
ComponentName componentName);
/**