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

Commit d717bb9a authored by Maryam Dehaini's avatar Maryam Dehaini Committed by Android (Google) Code Review
Browse files

Merge "Check if display allows for app header/handle to be shown even for...

Merge "Check if display allows for app header/handle to be shown even for freeform windows" into main
parents 09ecc500 92ee1334
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.wm.shell.windowdecor.common

import android.app.ActivityManager
import android.app.WindowConfiguration
import android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM
import android.view.Display
import android.view.WindowManager
import android.window.DesktopExperienceFlags.ENABLE_PROJECTED_DISPLAY_DESKTOP_MODE
@@ -48,15 +49,9 @@ class AppHandleAndHeaderVisibilityHelper(
     */
    fun shouldShowAppHandleOrHeader(taskInfo: ActivityManager.RunningTaskInfo): Boolean {

        // If DisplayController doesn't have it tracked, it could be a private/managed display, so
        // return false if display is null
        val display = displayController.getDisplay(taskInfo.displayId) ?: return false
        if (display == null) {
            // If DisplayController doesn't have it tracked, it could be a private/managed display.
            return false
        }
        // All freeform windows should show the app header.
        if (taskInfo.windowingMode == WindowConfiguration.WINDOWING_MODE_FREEFORM) {
            return true
        }

        if (!ENABLE_PROJECTED_DISPLAY_DESKTOP_MODE.isTrue) {
            return allowedForTask(taskInfo, display)
@@ -68,6 +63,10 @@ class AppHandleAndHeaderVisibilityHelper(
        taskInfo: ActivityManager.RunningTaskInfo,
        display: Display,
    ): Boolean {
        if (taskInfo.windowingMode == WINDOWING_MODE_FREEFORM) {
            return true
        }

        if (splitScreenController?.isTaskRootOrStageRoot(taskInfo.taskId) == true) {
            return false
        }