Merge changes I8ce5f791,Id8c23ece into udc-qpr-dev
* changes: Update BubbleBarExpandedView to have user specific code Add BAL flags to BubbleBarExpandedView
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.android.wm.shell.bubbles;
|
||||
|
||||
import static android.app.ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED;
|
||||
import static android.app.ActivityTaskManager.INVALID_TASK_ID;
|
||||
import static android.content.Intent.FLAG_ACTIVITY_MULTIPLE_TASK;
|
||||
import static android.content.Intent.FLAG_ACTIVITY_NEW_DOCUMENT;
|
||||
@@ -110,6 +111,9 @@ public class BubbleTaskViewHelper {
|
||||
try {
|
||||
options.setTaskAlwaysOnTop(true);
|
||||
options.setLaunchedFromBubble(true);
|
||||
options.setPendingIntentBackgroundActivityStartMode(
|
||||
MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
|
||||
options.setPendingIntentBackgroundActivityLaunchAllowedByPermission(true);
|
||||
|
||||
Intent fillInIntent = new Intent();
|
||||
// Apply flags to make behaviour match documentLaunchMode=always.
|
||||
@@ -117,11 +121,19 @@ public class BubbleTaskViewHelper {
|
||||
fillInIntent.addFlags(FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||
|
||||
if (mBubble.isAppBubble()) {
|
||||
PendingIntent pi = PendingIntent.getActivity(mContext, 0,
|
||||
mBubble.getAppBubbleIntent(),
|
||||
PendingIntent.FLAG_MUTABLE,
|
||||
null);
|
||||
mTaskView.startActivity(pi, fillInIntent, options, launchBounds);
|
||||
Context context =
|
||||
mContext.createContextAsUser(
|
||||
mBubble.getUser(), Context.CONTEXT_RESTRICTED);
|
||||
PendingIntent pi = PendingIntent.getActivity(
|
||||
context,
|
||||
/* requestCode= */ 0,
|
||||
mBubble.getAppBubbleIntent()
|
||||
.addFlags(FLAG_ACTIVITY_NEW_DOCUMENT)
|
||||
.addFlags(FLAG_ACTIVITY_MULTIPLE_TASK),
|
||||
PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT,
|
||||
/* options= */ null);
|
||||
mTaskView.startActivity(pi, /* fillInIntent= */ null, options,
|
||||
launchBounds);
|
||||
} else if (mBubble.hasMetadataShortcutId()) {
|
||||
options.setApplyActivityFlagsForBubbles(true);
|
||||
mTaskView.startShortcutActivity(mBubble.getShortcutInfo(),
|
||||
|
||||
Reference in New Issue
Block a user