summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Tate <ctate@google.com>2013-09-19 19:46:20 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-09-19 19:46:20 +0000
commit9c5cc571e5abf97a816fea2b04cd1e711e83564c (patch)
treea36af5ddb616b76d58470b2cdde4f001bfab2d5e
parent0286f5e2786865e35781180c88e67a0f981e942d (diff)
parentbd413f6c05d10ecd001b80c0f30fd031145da8ae (diff)
downloadframeworks_base-9c5cc571e5abf97a816fea2b04cd1e711e83564c.zip
frameworks_base-9c5cc571e5abf97a816fea2b04cd1e711e83564c.tar.gz
frameworks_base-9c5cc571e5abf97a816fea2b04cd1e711e83564c.tar.bz2
Merge "Support for "not the home app you're looking for" metadata" into klp-dev
-rw-r--r--api/current.txt1
-rw-r--r--core/java/android/app/ActivityManager.java7
-rwxr-xr-xservices/java/com/android/server/pm/PackageManagerService.java3
3 files changed, 10 insertions, 1 deletions
diff --git a/api/current.txt b/api/current.txt
index 15a19cc..b3e5c6e 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -2944,6 +2944,7 @@ package android.app {
method public void moveTaskToFront(int, int);
method public void moveTaskToFront(int, int, android.os.Bundle);
method public deprecated void restartPackage(java.lang.String);
+ field public static final java.lang.String META_HOME_ALTERNATE = "android.app.home.alternate";
field public static final int MOVE_TASK_NO_USER_ACTION = 2; // 0x2
field public static final int MOVE_TASK_WITH_HOME = 1; // 0x1
field public static final int RECENT_IGNORE_UNAVAILABLE = 2; // 0x2
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index 2d28280..8a62d18 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -68,6 +68,13 @@ public class ActivityManager {
private final Handler mHandler;
/**
+ * <meta-data> string for a 'home' Activity that names a package that is to be
+ * uninstalled in lieu of the declaring one. The package named here must be
+ * signed with the same certificate as the one declaring the <meta-data>.
+ */
+ public static final String META_HOME_ALTERNATE = "android.app.home.alternate";
+
+ /**
* Result for IActivityManager.startActivity: an error where the
* start had to be canceled.
* @hide
diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java
index decda96..d1ca35e 100755
--- a/services/java/com/android/server/pm/PackageManagerService.java
+++ b/services/java/com/android/server/pm/PackageManagerService.java
@@ -9883,7 +9883,8 @@ public class PackageManagerService extends IPackageManager.Stub {
intent.addCategory(Intent.CATEGORY_HOME);
final int callingUserId = UserHandle.getCallingUserId();
- List<ResolveInfo> list = queryIntentActivities(intent, null, 0, callingUserId);
+ List<ResolveInfo> list = queryIntentActivities(intent, null,
+ PackageManager.GET_META_DATA, callingUserId);
ResolveInfo preferred = findPreferredActivity(intent, null, 0, list, 0,
true, false, callingUserId);