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

Commit a4ce9e92 authored by Graciela Putri's avatar Graciela Putri Committed by Android (Google) Code Review
Browse files

Merge "[6/n] Add excludeCaptionFromAppBounds to devoptions" into main

parents 27f7129a 57049c14
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -115,6 +115,7 @@ public enum DesktopModeFlags {
    ENABLE_WINDOWING_SCALED_RESIZING(Flags::enableWindowingScaledResizing, true),
    ENABLE_WINDOWING_TRANSITION_HANDLERS_OBSERVERS(
            Flags::enableWindowingTransitionHandlersObservers, false),
    EXCLUDE_CAPTION_FROM_APP_BOUNDS(Flags::excludeCaptionFromAppBounds, false),
    INCLUDE_TOP_TRANSPARENT_FULLSCREEN_TASK_IN_DESKTOP_HEURISTIC(
            Flags::includeTopTransparentFullscreenTaskInDesktopHeuristic, true)
    // go/keep-sorted end
+1 −2
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ import android.content.pm.ActivityInfo.OVERRIDE_ENABLE_INSETS_DECOUPLED_CONFIGUR
import android.content.pm.ActivityInfo.OVERRIDE_EXCLUDE_CAPTION_INSETS_FROM_APP_BOUNDS
import android.window.DesktopModeFlags
import com.android.internal.R
import com.android.window.flags.Flags

/**
 * Class to decide whether to apply app compat policies in desktop mode.
@@ -64,7 +63,7 @@ class DesktopModeCompatPolicy(private val context: Context) {
     * is enabled.
     */
    fun shouldExcludeCaptionFromAppBounds(taskInfo: TaskInfo): Boolean =
        Flags.excludeCaptionFromAppBounds()
        DesktopModeFlags.EXCLUDE_CAPTION_FROM_APP_BOUNDS.isTrue
                && isAnyForceConsumptionFlagsEnabled()
                && taskInfo.topActivityInfo?.let {
            isInsetsCoupledWithConfiguration(it) && (!taskInfo.isResizeable || it.isChangeEnabled(
+3 −2
Original line number Diff line number Diff line
@@ -16,13 +16,14 @@

package com.android.server.wm;

import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
import static android.content.res.Configuration.ORIENTATION_UNDEFINED;
import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
import static android.window.DesktopModeFlags.EXCLUDE_CAPTION_FROM_APP_BOUNDS;

import static com.android.server.wm.AppCompatConfiguration.LETTERBOX_BACKGROUND_WALLPAPER;
import static com.android.server.wm.AppCompatConfiguration.letterboxBackgroundTypeToString;
@@ -311,7 +312,7 @@ class AppCompatLetterboxPolicy {
    }

    private boolean isFreeformActivityMatchParentAppBoundsHeight() {
        if (!Flags.excludeCaptionFromAppBounds()) {
        if (!EXCLUDE_CAPTION_FROM_APP_BOUNDS.isTrue()) {
            return false;
        }
        final Task task = mActivityRecord.getTask();
+3 −3
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@
 */
package com.android.server.wm;

import static android.window.DesktopModeFlags.EXCLUDE_CAPTION_FROM_APP_BOUNDS;

import static com.android.server.wm.AppCompatUtils.isInDesktopMode;

import android.annotation.NonNull;
@@ -22,8 +24,6 @@ import android.app.WindowConfiguration.WindowingMode;
import android.content.res.Configuration;
import android.graphics.Rect;

import com.android.window.flags.Flags;

/**
 * Encapsulate logic related to sandboxing for app compatibility.
 */
@@ -48,7 +48,7 @@ class AppCompatSandboxingPolicy {
     */
    void sandboxBoundsIfNeeded(@NonNull Configuration resolvedConfig,
            @WindowingMode int windowingMode) {
        if (!Flags.excludeCaptionFromAppBounds()) {
        if (!EXCLUDE_CAPTION_FROM_APP_BOUNDS.isTrue()) {
            return;
        }