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

Commit 87ae315d authored by Annie Lin's avatar Annie Lin
Browse files

Fix the incorrect calculation of the smallest screen width dp for app bubble task behind flags.

Bug: 384610303
Fix: 408276451
Fix: 409387368
Fix: 415920958
Fix: 415899635
Fix: 416541354
Before: screenshot/6cnaJcnnsznzBaz
After: screenshot/7P2nDnLcU9eZD83
Test: verify sw config of an bubble'd activity
Flag: com.android.wm.shell.enable_create_any_bubble
Flag: com.android.wm.shell.enable_bubble_app_compat_fixes
Change-Id: I3d39c4ad4c7dcda90780ff3306357b4a917be416
parent ea8a433d
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -2521,7 +2521,18 @@ class TaskFragment extends WindowContainer<WindowContainer> {
                // We should just inherit the value from parent for this temporary state.
                final boolean inPipTransition = windowingMode == WINDOWING_MODE_PINNED
                        && !mTmpFullBounds.isEmpty() && mTmpFullBounds.equals(parentBounds);
                if (WindowConfiguration.isFloating(windowingMode) && !inPipTransition) {
                // For floating tasks and app bubbles, calculate the smallest width from the bounds
                // of the task, because they should not be affected by insets.
                boolean shouldUseTaskBounds = WindowConfiguration.isFloating(windowingMode);
                if (com.android.wm.shell.Flags.enableCreateAnyBubble()
                        && com.android.wm.shell.Flags.enableBubbleAppCompatFixes()) {
                    final Task task = getTask();
                    if (task != null) {
                        // TODO(b/407669465): Update isAppBubble usage once migrated.
                        shouldUseTaskBounds |= task.getTaskInfo().isAppBubble;
                    }
                }
                if (shouldUseTaskBounds && !inPipTransition) {
                    // For floating tasks, calculate the smallest width from the bounds of the
                    // task, because they should not be affected by insets.
                    inOutConfig.smallestScreenWidthDp = (int) (0.5f