From 94a07acba7e43028e98da1082b5b8b1d95667a6c Mon Sep 17 00:00:00 2001 From: Kenny Guy Date: Thu, 7 Aug 2014 15:34:38 +0100 Subject: Launch application details for correct profile from recents. Bug: 16681400 Change-Id: Ia80d9c83809b07b1cdc4be8a4fc8a406bdfcf55e --- .../SystemUI/src/com/android/systemui/recent/RecentsPanelView.java | 6 +++--- .../src/com/android/systemui/recents/views/RecentsView.java | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java index 98bdee0c16ea..2a782cc09935 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java @@ -738,12 +738,12 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener } } - private void startApplicationDetailsActivity(String packageName) { + private void startApplicationDetailsActivity(String packageName, int userId) { Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.fromParts("package", packageName, null)); intent.setComponent(intent.resolveActivity(getContext().getPackageManager())); TaskStackBuilder.create(getContext()) - .addNextIntentWithParentStack(intent).startActivities(); + .addNextIntentWithParentStack(intent).startActivities(null, new UserHandle(userId)); } public boolean onInterceptTouchEvent(MotionEvent ev) { @@ -769,7 +769,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener ViewHolder viewHolder = (ViewHolder) selectedView.getTag(); if (viewHolder != null) { final TaskDescription ad = viewHolder.taskDescription; - startApplicationDetailsActivity(ad.packageName); + startApplicationDetailsActivity(ad.packageName, ad.userId); show(false); } else { throw new IllegalStateException("Oops, no tag on view " + selectedView); diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java index 1a32b81c767e..58d5df77c59e 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java @@ -26,6 +26,7 @@ import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Rect; import android.net.Uri; +import android.os.UserHandle; import android.provider.Settings; import android.util.AttributeSet; import android.view.LayoutInflater; @@ -474,7 +475,8 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV Uri.fromParts("package", baseIntent.getComponent().getPackageName(), null)); intent.setComponent(intent.resolveActivity(getContext().getPackageManager())); TaskStackBuilder.create(getContext()) - .addNextIntentWithParentStack(intent).startActivities(); + .addNextIntentWithParentStack(intent).startActivities(null, + new UserHandle(t.userId)); } @Override -- cgit v1.2.3-59-g8ed1b