From ec084c6e91580555090e9d2c292e89224d9c9135 Mon Sep 17 00:00:00 2001 From: Ben Lin Date: Wed, 9 Sep 2020 13:02:44 -0700 Subject: [PATCH] PiP: Start PiP settings as current user. Previously since PipMenuActivity was started as current user, starting the new settings activity as the same user works. However now that Settings activity starts from SysUI directly (which would be SysUI's primary user), that no longer works - we need to now be explicit about using current user again. Bug: 166468109 Test: Enter PIP, press settings gear icon - Settings open Change-Id: Iaf257405a38d026ff576e747a6a443ab9e4dd8b5 --- .../src/com/android/systemui/pip/phone/PipMenuView.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuView.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuView.java index 993bfe04f9a31..c66f442c4c0de 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuView.java +++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuView.java @@ -475,12 +475,10 @@ public class PipMenuView extends FrameLayout { final Pair topPipActivityInfo = PipUtils.getTopPipActivity(mContext, ActivityManager.getService()); if (topPipActivityInfo.first != null) { - final UserHandle user = UserHandle.of(topPipActivityInfo.second); final Intent settingsIntent = new Intent(ACTION_PICTURE_IN_PICTURE_SETTINGS, Uri.fromParts("package", topPipActivityInfo.first.getPackageName(), null)); - settingsIntent.putExtra(Intent.EXTRA_USER_HANDLE, user); settingsIntent.setFlags(FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK); - mContext.startActivity(settingsIntent); + mContext.startActivityAsUser(settingsIntent, UserHandle.CURRENT); } }