summaryrefslogtreecommitdiffstats
path: root/core/java/android/content
diff options
context:
space:
mode:
authorAdnan Begovic <adnan@cyngn.com>2016-01-19 16:13:21 -0800
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-01-22 15:28:25 -0800
commit5f31f27783f19a5cc4368eca3c8005d290a10247 (patch)
treeac50a148702ff5d913fe0e3ad07b9c8375b1711f /core/java/android/content
parent35671166550919d7db37b2084ca2bc6d9595e71a (diff)
downloadframeworks_base-5f31f27783f19a5cc4368eca3c8005d290a10247.zip
frameworks_base-5f31f27783f19a5cc4368eca3c8005d290a10247.tar.gz
frameworks_base-5f31f27783f19a5cc4368eca3c8005d290a10247.tar.bz2
fw: Fix protected apps implementation.
Currently a protected component could be accessed from any other means other than the launcher, entirely defeating its purpose. Instead, hook into the activity stack supervisor and quelch attempts at invocation of protected components. This implementation also provides feedback to the user on any attempt to start the component when its in a protected state. TICKET: CYNGNOS-84 Change-Id: Ib0165e7504adb08e21e9566c7394b37dffd280d4
Diffstat (limited to 'core/java/android/content')
-rw-r--r--core/java/android/content/pm/IPackageManager.aidl4
-rw-r--r--core/java/android/content/pm/PackageManager.java7
2 files changed, 11 insertions, 0 deletions
diff --git a/core/java/android/content/pm/IPackageManager.aidl b/core/java/android/content/pm/IPackageManager.aidl
index 7c77f54..6d8b5cb 100644
--- a/core/java/android/content/pm/IPackageManager.aidl
+++ b/core/java/android/content/pm/IPackageManager.aidl
@@ -519,4 +519,8 @@ interface IPackageManager {
void updateIconMapping(String pkgName);
ComposedIconInfo getComposedIconInfo();
int processThemeResources(String themePkgName);
+
+ /** Protected Apps */
+ boolean isComponentProtected(in String callingPackage, in ComponentName componentName,
+ int userId);
}
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index 8928ad3..529d641 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -4561,6 +4561,13 @@ public abstract class PackageManager {
public abstract void setComponentProtectedSetting(ComponentName componentName, boolean newState);
/**
+ * Return whether or not a specific component is protected
+ * @hide
+ */
+ public abstract boolean isComponentProtected(String callingPackage,
+ ComponentName componentName);
+
+ /**
* Adds a {@link CrossProfileIntentFilter}. After calling this method all intents sent from the
* user with id sourceUserId can also be be resolved by activities in the user with id
* targetUserId if they match the specified intent filter.