Loading core/java/android/app/ActivityOptions.java +24 −0 Original line number Diff line number Diff line Loading @@ -265,6 +265,14 @@ public class ActivityOptions { private static final String KEY_DISALLOW_ENTER_PICTURE_IN_PICTURE_WHILE_LAUNCHING = "android:activity.disallowEnterPictureInPictureWhileLaunching"; /** * Indicates flags should be applied to the launching activity such that it will behave * correctly in a bubble. * @hide */ private static final String KEY_APPLY_ACTIVITY_FLAGS_FOR_BUBBLES = "android:activity.applyActivityFlagsForBubbles"; /** * For Activity transitions, the calling Activity's TransitionListener used to * notify the called Activity when the shared element and the exit transitions Loading Loading @@ -354,6 +362,7 @@ public class ActivityOptions { private int mSplitScreenCreateMode = SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT; private boolean mLockTaskMode = false; private boolean mDisallowEnterPictureInPictureWhileLaunching; private boolean mApplyActivityFlagsForBubbles; private boolean mTaskAlwaysOnTop; private boolean mTaskOverlay; private boolean mTaskOverlayCanResume; Loading Loading @@ -1033,6 +1042,8 @@ public class ActivityOptions { SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT); mDisallowEnterPictureInPictureWhileLaunching = opts.getBoolean( KEY_DISALLOW_ENTER_PICTURE_IN_PICTURE_WHILE_LAUNCHING, false); mApplyActivityFlagsForBubbles = opts.getBoolean( KEY_APPLY_ACTIVITY_FLAGS_FOR_BUBBLES, false); if (opts.containsKey(KEY_ANIM_SPECS)) { Parcelable[] specs = opts.getParcelableArray(KEY_ANIM_SPECS); mAnimSpecs = new AppTransitionAnimationSpec[specs.length]; Loading Loading @@ -1465,6 +1476,16 @@ public class ActivityOptions { return mDisallowEnterPictureInPictureWhileLaunching; } /** @hide */ public void setApplyActivityFlagsForBubbles(boolean apply) { mApplyActivityFlagsForBubbles = apply; } /** @hide */ public boolean isApplyActivityFlagsForBubbles() { return mApplyActivityFlagsForBubbles; } /** * Update the current values in this ActivityOptions from those supplied * in <var>otherOptions</var>. Any values Loading Loading @@ -1663,6 +1684,9 @@ public class ActivityOptions { b.putBoolean(KEY_DISALLOW_ENTER_PICTURE_IN_PICTURE_WHILE_LAUNCHING, mDisallowEnterPictureInPictureWhileLaunching); } if (mApplyActivityFlagsForBubbles) { b.putBoolean(KEY_APPLY_ACTIVITY_FLAGS_FOR_BUBBLES, mApplyActivityFlagsForBubbles); } if (mAnimSpecs != null) { b.putParcelableArray(KEY_ANIM_SPECS, mAnimSpecs); } Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java +1 −0 Original line number Diff line number Diff line Loading @@ -131,6 +131,7 @@ public class BubbleExpandedView extends LinearLayout { } try { if (!mIsOverflow && mBubble.usingShortcutInfo()) { options.setApplyActivityFlagsForBubbles(true); mActivityView.startShortcutActivity(mBubble.getShortcutInfo(), options, null /* sourceBounds */); } else { Loading services/core/java/com/android/server/pm/LauncherAppsService.java +12 −0 Original line number Diff line number Diff line Loading @@ -16,11 +16,15 @@ package com.android.server.pm; import static android.content.Intent.FLAG_ACTIVITY_MULTIPLE_TASK; import static android.content.Intent.FLAG_ACTIVITY_NEW_DOCUMENT; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.UserIdInt; import android.app.ActivityManager; import android.app.ActivityManagerInternal; import android.app.ActivityOptions; import android.app.AppGlobals; import android.app.IApplicationThread; import android.app.PendingIntent; Loading Loading @@ -864,6 +868,14 @@ public class LauncherAppsService extends SystemService { } // Note the target activity doesn't have to be exported. // Flag for bubble ActivityOptions options = ActivityOptions.fromBundle(startActivityOptions); if (options != null && options.isApplyActivityFlagsForBubbles()) { // Flag for bubble to make behaviour match documentLaunchMode=always. intents[0].addFlags(FLAG_ACTIVITY_NEW_DOCUMENT); intents[0].addFlags(FLAG_ACTIVITY_MULTIPLE_TASK); } intents[0].addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intents[0].setSourceBounds(sourceBounds); Loading Loading
core/java/android/app/ActivityOptions.java +24 −0 Original line number Diff line number Diff line Loading @@ -265,6 +265,14 @@ public class ActivityOptions { private static final String KEY_DISALLOW_ENTER_PICTURE_IN_PICTURE_WHILE_LAUNCHING = "android:activity.disallowEnterPictureInPictureWhileLaunching"; /** * Indicates flags should be applied to the launching activity such that it will behave * correctly in a bubble. * @hide */ private static final String KEY_APPLY_ACTIVITY_FLAGS_FOR_BUBBLES = "android:activity.applyActivityFlagsForBubbles"; /** * For Activity transitions, the calling Activity's TransitionListener used to * notify the called Activity when the shared element and the exit transitions Loading Loading @@ -354,6 +362,7 @@ public class ActivityOptions { private int mSplitScreenCreateMode = SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT; private boolean mLockTaskMode = false; private boolean mDisallowEnterPictureInPictureWhileLaunching; private boolean mApplyActivityFlagsForBubbles; private boolean mTaskAlwaysOnTop; private boolean mTaskOverlay; private boolean mTaskOverlayCanResume; Loading Loading @@ -1033,6 +1042,8 @@ public class ActivityOptions { SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT); mDisallowEnterPictureInPictureWhileLaunching = opts.getBoolean( KEY_DISALLOW_ENTER_PICTURE_IN_PICTURE_WHILE_LAUNCHING, false); mApplyActivityFlagsForBubbles = opts.getBoolean( KEY_APPLY_ACTIVITY_FLAGS_FOR_BUBBLES, false); if (opts.containsKey(KEY_ANIM_SPECS)) { Parcelable[] specs = opts.getParcelableArray(KEY_ANIM_SPECS); mAnimSpecs = new AppTransitionAnimationSpec[specs.length]; Loading Loading @@ -1465,6 +1476,16 @@ public class ActivityOptions { return mDisallowEnterPictureInPictureWhileLaunching; } /** @hide */ public void setApplyActivityFlagsForBubbles(boolean apply) { mApplyActivityFlagsForBubbles = apply; } /** @hide */ public boolean isApplyActivityFlagsForBubbles() { return mApplyActivityFlagsForBubbles; } /** * Update the current values in this ActivityOptions from those supplied * in <var>otherOptions</var>. Any values Loading Loading @@ -1663,6 +1684,9 @@ public class ActivityOptions { b.putBoolean(KEY_DISALLOW_ENTER_PICTURE_IN_PICTURE_WHILE_LAUNCHING, mDisallowEnterPictureInPictureWhileLaunching); } if (mApplyActivityFlagsForBubbles) { b.putBoolean(KEY_APPLY_ACTIVITY_FLAGS_FOR_BUBBLES, mApplyActivityFlagsForBubbles); } if (mAnimSpecs != null) { b.putParcelableArray(KEY_ANIM_SPECS, mAnimSpecs); } Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java +1 −0 Original line number Diff line number Diff line Loading @@ -131,6 +131,7 @@ public class BubbleExpandedView extends LinearLayout { } try { if (!mIsOverflow && mBubble.usingShortcutInfo()) { options.setApplyActivityFlagsForBubbles(true); mActivityView.startShortcutActivity(mBubble.getShortcutInfo(), options, null /* sourceBounds */); } else { Loading
services/core/java/com/android/server/pm/LauncherAppsService.java +12 −0 Original line number Diff line number Diff line Loading @@ -16,11 +16,15 @@ package com.android.server.pm; import static android.content.Intent.FLAG_ACTIVITY_MULTIPLE_TASK; import static android.content.Intent.FLAG_ACTIVITY_NEW_DOCUMENT; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.UserIdInt; import android.app.ActivityManager; import android.app.ActivityManagerInternal; import android.app.ActivityOptions; import android.app.AppGlobals; import android.app.IApplicationThread; import android.app.PendingIntent; Loading Loading @@ -864,6 +868,14 @@ public class LauncherAppsService extends SystemService { } // Note the target activity doesn't have to be exported. // Flag for bubble ActivityOptions options = ActivityOptions.fromBundle(startActivityOptions); if (options != null && options.isApplyActivityFlagsForBubbles()) { // Flag for bubble to make behaviour match documentLaunchMode=always. intents[0].addFlags(FLAG_ACTIVITY_NEW_DOCUMENT); intents[0].addFlags(FLAG_ACTIVITY_MULTIPLE_TASK); } intents[0].addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intents[0].setSourceBounds(sourceBounds); Loading