Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2ee9f1a authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Update code guarded by bubble anything / bubble to fullscreen" into main

parents 64370ffc b0031466
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -56,6 +56,7 @@ import com.android.wm.shell.bubbles.bar.BubbleBarExpandedView;
import com.android.wm.shell.bubbles.bar.BubbleBarLayerView;
import com.android.wm.shell.bubbles.bar.BubbleBarLayerView;
import com.android.wm.shell.shared.annotations.ShellBackgroundThread;
import com.android.wm.shell.shared.annotations.ShellBackgroundThread;
import com.android.wm.shell.shared.annotations.ShellMainThread;
import com.android.wm.shell.shared.annotations.ShellMainThread;
import com.android.wm.shell.shared.bubbles.BubbleAnythingFlagHelper;
import com.android.wm.shell.shared.bubbles.BubbleInfo;
import com.android.wm.shell.shared.bubbles.BubbleInfo;
import com.android.wm.shell.shared.bubbles.ParcelableFlyoutMessage;
import com.android.wm.shell.shared.bubbles.ParcelableFlyoutMessage;
import com.android.wm.shell.taskview.TaskView;
import com.android.wm.shell.taskview.TaskView;
@@ -1093,7 +1094,7 @@ public class Bubble implements BubbleViewProvider {
     * intent for an app. In this case we don't show a badge on the icon.
     * intent for an app. In this case we don't show a badge on the icon.
     */
     */
    public boolean isAppLaunchIntent() {
    public boolean isAppLaunchIntent() {
        if (Flags.enableBubbleAnything() && mAppIntent != null) {
        if (BubbleAnythingFlagHelper.enableCreateAnyBubble() && mAppIntent != null) {
            return mAppIntent.hasCategory("android.intent.category.LAUNCHER");
            return mAppIntent.hasCategory("android.intent.category.LAUNCHER");
        }
        }
        return false;
        return false;
+3 −3
Original line number Original line Diff line number Diff line
@@ -1433,7 +1433,7 @@ public class BubbleController implements ConfigurationChangeListener,
     * @param info the shortcut info for the bubble.
     * @param info the shortcut info for the bubble.
     */
     */
    public void expandStackAndSelectBubble(ShortcutInfo info) {
    public void expandStackAndSelectBubble(ShortcutInfo info) {
        if (!Flags.enableBubbleAnything()) return;
        if (!BubbleAnythingFlagHelper.enableCreateAnyBubble()) return;
        Bubble b = mBubbleData.getOrCreateBubble(info); // Removes from overflow
        Bubble b = mBubbleData.getOrCreateBubble(info); // Removes from overflow
        ProtoLog.v(WM_SHELL_BUBBLES, "expandStackAndSelectBubble - shortcut=%s", info);
        ProtoLog.v(WM_SHELL_BUBBLES, "expandStackAndSelectBubble - shortcut=%s", info);
        if (b.isInflated()) {
        if (b.isInflated()) {
@@ -1450,7 +1450,7 @@ public class BubbleController implements ConfigurationChangeListener,
     * @param intent the intent for the bubble.
     * @param intent the intent for the bubble.
     */
     */
    public void expandStackAndSelectBubble(Intent intent, UserHandle user) {
    public void expandStackAndSelectBubble(Intent intent, UserHandle user) {
        if (!Flags.enableBubbleAnything()) return;
        if (!BubbleAnythingFlagHelper.enableCreateAnyBubble()) return;
        Bubble b = mBubbleData.getOrCreateBubble(intent, user); // Removes from overflow
        Bubble b = mBubbleData.getOrCreateBubble(intent, user); // Removes from overflow
        ProtoLog.v(WM_SHELL_BUBBLES, "expandStackAndSelectBubble - intent=%s", intent);
        ProtoLog.v(WM_SHELL_BUBBLES, "expandStackAndSelectBubble - intent=%s", intent);
        if (b.isInflated()) {
        if (b.isInflated()) {
@@ -2516,7 +2516,7 @@ public class BubbleController implements ConfigurationChangeListener,
     * @param entry   the entry to bubble.
     * @param entry   the entry to bubble.
     */
     */
    static boolean canLaunchInTaskView(Context context, BubbleEntry entry) {
    static boolean canLaunchInTaskView(Context context, BubbleEntry entry) {
        if (Flags.enableBubbleAnything()) return true;
        if (BubbleAnythingFlagHelper.enableCreateAnyBubble()) return true;
        PendingIntent intent = entry.getBubbleMetadata() != null
        PendingIntent intent = entry.getBubbleMetadata() != null
                ? entry.getBubbleMetadata().getIntent()
                ? entry.getBubbleMetadata().getIntent()
                : null;
                : null;
+3 −1
Original line number Original line Diff line number Diff line
@@ -71,6 +71,7 @@ import com.android.wm.shell.Flags;
import com.android.wm.shell.R;
import com.android.wm.shell.R;
import com.android.wm.shell.common.AlphaOptimizedButton;
import com.android.wm.shell.common.AlphaOptimizedButton;
import com.android.wm.shell.shared.TriangleShape;
import com.android.wm.shell.shared.TriangleShape;
import com.android.wm.shell.shared.bubbles.BubbleAnythingFlagHelper;
import com.android.wm.shell.taskview.TaskView;
import com.android.wm.shell.taskview.TaskView;


import java.io.PrintWriter;
import java.io.PrintWriter;
@@ -226,7 +227,8 @@ public class BubbleExpandedView extends LinearLayout {
                            MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS);
                            MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS);


                    final boolean isShortcutBubble = (mBubble.hasMetadataShortcutId()
                    final boolean isShortcutBubble = (mBubble.hasMetadataShortcutId()
                            || (mBubble.getShortcutInfo() != null && Flags.enableBubbleAnything()));
                            || (mBubble.getShortcutInfo() != null
                            && BubbleAnythingFlagHelper.enableCreateAnyBubble()));


                    if (mBubble.isAppBubble()) {
                    if (mBubble.isAppBubble()) {
                        Context context =
                        Context context =
+3 −2
Original line number Original line Diff line number Diff line
@@ -36,7 +36,7 @@ import android.view.ViewGroup;
import androidx.annotation.Nullable;
import androidx.annotation.Nullable;


import com.android.internal.protolog.ProtoLog;
import com.android.internal.protolog.ProtoLog;
import com.android.wm.shell.Flags;
import com.android.wm.shell.shared.bubbles.BubbleAnythingFlagHelper;
import com.android.wm.shell.taskview.TaskView;
import com.android.wm.shell.taskview.TaskView;


/**
/**
@@ -108,7 +108,8 @@ public class BubbleTaskViewHelper {
                    options.setPendingIntentBackgroundActivityStartMode(
                    options.setPendingIntentBackgroundActivityStartMode(
                            MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS);
                            MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS);
                    final boolean isShortcutBubble = (mBubble.hasMetadataShortcutId()
                    final boolean isShortcutBubble = (mBubble.hasMetadataShortcutId()
                            || (mBubble.getShortcutInfo() != null && Flags.enableBubbleAnything()));
                            || (mBubble.getShortcutInfo() != null
                            && BubbleAnythingFlagHelper.enableCreateAnyBubble()));
                    if (mBubble.getPreparingTransition() != null) {
                    if (mBubble.getPreparingTransition() != null) {
                        mBubble.getPreparingTransition().surfaceCreated();
                        mBubble.getPreparingTransition().surfaceCreated();
                    } else if (mBubble.isAppBubble()) {
                    } else if (mBubble.isAppBubble()) {
+2 −1
Original line number Original line Diff line number Diff line
@@ -49,6 +49,7 @@ import com.android.window.flags.Flags
import com.android.wm.shell.R
import com.android.wm.shell.R
import com.android.wm.shell.shared.annotations.ShellBackgroundThread
import com.android.wm.shell.shared.annotations.ShellBackgroundThread
import com.android.wm.shell.shared.annotations.ShellMainThread
import com.android.wm.shell.shared.annotations.ShellMainThread
import com.android.wm.shell.shared.bubbles.BubbleAnythingFlagHelper
import com.android.wm.shell.shared.split.SplitScreenConstants
import com.android.wm.shell.shared.split.SplitScreenConstants
import com.android.wm.shell.splitscreen.SplitScreenController
import com.android.wm.shell.splitscreen.SplitScreenController
import com.android.wm.shell.windowdecor.additionalviewcontainer.AdditionalSystemViewContainer
import com.android.wm.shell.windowdecor.additionalviewcontainer.AdditionalSystemViewContainer
@@ -645,7 +646,7 @@ class HandleMenu(
        private fun bindWindowingPill(style: MenuStyle) {
        private fun bindWindowingPill(style: MenuStyle) {
            windowingPill.background.setTint(style.backgroundColor)
            windowingPill.background.setTint(style.backgroundColor)


            if (!com.android.wm.shell.Flags.enableBubbleAnything()) {
            if (!BubbleAnythingFlagHelper.enableBubbleToFullscreen()) {
                floatingBtn.visibility = View.GONE
                floatingBtn.visibility = View.GONE
            }
            }