diff options
| author | Dianne Hackborn <hackbod@google.com> | 2012-09-23 12:58:09 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-09-23 12:58:10 -0700 |
| commit | b939e35274334d1f5e71a526efe8d235eb6d7387 (patch) | |
| tree | 9292319858bd01ec3bd01f132405c9a13620ed7e | |
| parent | 925b6a715f42296dee7d80c3a3b4024d264a3c97 (diff) | |
| parent | 8da429e80d1778d7bcfbfbd64355c70fb466b3ce (diff) | |
| download | frameworks_base-b939e35274334d1f5e71a526efe8d235eb6d7387.zip frameworks_base-b939e35274334d1f5e71a526efe8d235eb6d7387.tar.gz frameworks_base-b939e35274334d1f5e71a526efe8d235eb6d7387.tar.bz2 | |
Merge "Fix issue #7209355, #7214271." into jb-mr1-dev
5 files changed, 32 insertions, 6 deletions
diff --git a/api/current.txt b/api/current.txt index 0b759b2..7eabad8 100644 --- a/api/current.txt +++ b/api/current.txt @@ -6770,6 +6770,7 @@ package android.content.pm { public class ResolveInfo implements android.os.Parcelable { ctor public ResolveInfo(); + ctor public ResolveInfo(android.content.pm.ResolveInfo); method public int describeContents(); method public void dump(android.util.Printer, java.lang.String); method public final int getIconResource(); diff --git a/core/java/android/content/pm/ResolveInfo.java b/core/java/android/content/pm/ResolveInfo.java index e3749b4..07117fe 100644 --- a/core/java/android/content/pm/ResolveInfo.java +++ b/core/java/android/content/pm/ResolveInfo.java @@ -230,6 +230,21 @@ public class ResolveInfo implements Parcelable { public ResolveInfo() { } + public ResolveInfo(ResolveInfo orig) { + activityInfo = orig.activityInfo; + serviceInfo = orig.serviceInfo; + filter = orig.filter; + priority = orig.priority; + preferredOrder = orig.preferredOrder; + match = orig.match; + specificIndex = orig.specificIndex; + labelRes = orig.labelRes; + nonLocalizedLabel = orig.nonLocalizedLabel; + icon = orig.icon; + resolvePackageName = orig.resolvePackageName; + system = orig.system; + } + public String toString() { ComponentInfo ci = activityInfo != null ? activityInfo : serviceInfo; return "ResolveInfo{" diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java index 0caa671..5296ae9 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java @@ -538,12 +538,14 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener } private void updateUiElements() { - final int items = mRecentTaskDescriptions.size(); + final int items = mRecentTaskDescriptions != null + ? mRecentTaskDescriptions.size() : 0; mRecentsContainer.setVisibility(items > 0 ? View.VISIBLE : View.GONE); // Set description for accessibility - int numRecentApps = mRecentTaskDescriptions.size(); + int numRecentApps = mRecentTaskDescriptions != null + ? mRecentTaskDescriptions.size() : 0; String recentAppsAccessibilityDescription; if (numRecentApps == 0) { recentAppsAccessibilityDescription = diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java index 32907f8..1707ff0 100755 --- a/services/java/com/android/server/am/ActivityStack.java +++ b/services/java/com/android/server/am/ActivityStack.java @@ -4390,6 +4390,8 @@ final class ActivityStack { while (j < NA) { ActivityRecord ar = mHistory.get(j); if (!ar.finishing && ar.task.taskId == taskId) { + thumbs.root = ar; + thumbs.rootIndex = j; holder = ar.thumbHolder; if (holder != null) { thumbs.mainThumbnail = holder.lastThumbnail; @@ -4404,9 +4406,6 @@ final class ActivityStack { return thumbs; } - thumbs.root = mHistory.get(j); - thumbs.rootIndex = j; - ArrayList<TaskAccessInfo.SubTask> subtasks = new ArrayList<TaskAccessInfo.SubTask>(); thumbs.subtasks = subtasks; while (j < NA) { diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java index 3f2387b..89c0efa 100644 --- a/services/java/com/android/server/pm/PackageManagerService.java +++ b/services/java/com/android/server/pm/PackageManagerService.java @@ -2488,6 +2488,15 @@ public class PackageManagerService extends IPackageManager.Stub { if (ri != null) { return ri; } + if (userId != 0) { + ri = new ResolveInfo(mResolveInfo); + ri.activityInfo = new ActivityInfo(ri.activityInfo); + ri.activityInfo.applicationInfo = new ApplicationInfo( + ri.activityInfo.applicationInfo); + ri.activityInfo.applicationInfo.uid = UserHandle.getUid(userId, + UserHandle.getAppId(ri.activityInfo.applicationInfo.uid)); + return ri; + } return mResolveInfo; } } @@ -3668,7 +3677,7 @@ public class PackageManagerService extends IPackageManager.Stub { mResolveActivity.applicationInfo = mAndroidApplication; mResolveActivity.name = ResolverActivity.class.getName(); mResolveActivity.packageName = mAndroidApplication.packageName; - mResolveActivity.processName = mAndroidApplication.processName; + mResolveActivity.processName = "system:ui"; mResolveActivity.launchMode = ActivityInfo.LAUNCH_MULTIPLE; mResolveActivity.flags = ActivityInfo.FLAG_EXCLUDE_FROM_RECENTS; mResolveActivity.theme = com.android.internal.R.style.Theme_Holo_Dialog_Alert; |
