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

Commit 46e41e4f authored by Eghosa Ewansiha-Vlachavas's avatar Eghosa Ewansiha-Vlachavas Committed by Android (Google) Code Review
Browse files

Merge changes I4c34111a,I62aa1748 into main

* changes:
  [1/n] Don't apply aspect ratio restrictions for resizeable activities in desktop mode
  [0/n] Bug fix flag for ignoring aspect ratio when freeform resizeable
parents d64d9589 bee01125
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
package: "com.android.window.flags"
container: "system"

flag {
  name: "ignore_aspect_ratio_restrictions_for_resizeable_freeform_activities"
  namespace: "large_screen_experiences_app_compat"
  description: "If a resizeable activity enters freeform mode, ignore all aspect ratio constraints."
  bug: "381866902"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}

flag {
  name: "allows_screen_size_decoupled_from_status_bar_and_cutout"
  namespace: "large_screen_experiences_app_compat"
+11 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.server.wm;

import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.content.pm.ActivityInfo.OVERRIDE_MIN_ASPECT_RATIO_EXCLUDE_PORTRAIT_FULLSCREEN;
import static android.content.pm.ActivityInfo.OVERRIDE_MIN_ASPECT_RATIO_LARGE;
@@ -36,6 +37,8 @@ import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.graphics.Rect;

import com.android.window.flags.Flags;

/**
 * Encapsulate app compat policy logic related to aspect ratio.
 */
@@ -239,7 +242,14 @@ class AppCompatAspectRatioPolicy {
                || AppCompatUtils.isInVrUiMode(mActivityRecord.getConfiguration())
                // TODO(b/232898850): Always respect aspect ratio requests.
                // Don't set aspect ratio for activity in ActivityEmbedding split.
                || (organizedTf != null && !organizedTf.fillsParent())) {
                || (organizedTf != null && !organizedTf.fillsParent())
                // Don't set aspect ratio for resizeable activities in freeform.
                // {@link ActivityRecord#shouldCreateAppCompatDisplayInsets()} will be false for
                // both activities that are naturally resizeable and activities that have been
                // forced resizeable.
                || (Flags.ignoreAspectRatioRestrictionsForResizeableFreeformActivities()
                    && task.getWindowingMode() == WINDOWING_MODE_FREEFORM
                    && !mActivityRecord.shouldCreateAppCompatDisplayInsets())) {
            return false;
        }