Loading core/java/android/app/TaskInfo.java +12 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import android.os.Build; import android.os.IBinder; import android.os.Parcel; import android.view.DisplayCutout; import android.view.WindowInsets; import android.window.WindowContainerToken; import java.util.ArrayList; Loading Loading @@ -328,6 +329,13 @@ public class TaskInfo { */ public long capturedLinkTimestamp; /** * The requested visible types of insets. * @hide */ @WindowInsets.Type.InsetsType public int requestedVisibleTypes; /** * Encapsulate specific App Compat information. * @hide Loading Loading @@ -465,6 +473,7 @@ public class TaskInfo { && lastNonFullscreenBounds == this.lastNonFullscreenBounds && Objects.equals(capturedLink, that.capturedLink) && capturedLinkTimestamp == that.capturedLinkTimestamp && requestedVisibleTypes == that.requestedVisibleTypes && appCompatTaskInfo.equalsForTaskOrganizer(that.appCompatTaskInfo); } Loading Loading @@ -539,6 +548,7 @@ public class TaskInfo { lastNonFullscreenBounds = source.readTypedObject(Rect.CREATOR); capturedLink = source.readTypedObject(Uri.CREATOR); capturedLinkTimestamp = source.readLong(); requestedVisibleTypes = source.readInt(); appCompatTaskInfo = source.readTypedObject(AppCompatTaskInfo.CREATOR); } Loading Loading @@ -591,6 +601,7 @@ public class TaskInfo { dest.writeTypedObject(lastNonFullscreenBounds, flags); dest.writeTypedObject(capturedLink, flags); dest.writeLong(capturedLinkTimestamp); dest.writeInt(requestedVisibleTypes); dest.writeTypedObject(appCompatTaskInfo, flags); } Loading Loading @@ -633,6 +644,7 @@ public class TaskInfo { + " lastNonFullscreenBounds=" + lastNonFullscreenBounds + " capturedLink=" + capturedLink + " capturedLinkTimestamp=" + capturedLinkTimestamp + " requestedVisibleTypes=" + requestedVisibleTypes + " appCompatTaskInfo=" + appCompatTaskInfo + "}"; } Loading libs/WindowManager/Shell/res/drawable/decor_desktop_mode_immersive_button_dark.xml 0 → 100644 +25 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2024 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:width="24dp" android:viewportWidth="24" android:viewportHeight="24"> <path android:fillColor="#000000" android:pathData="M5,5H10V7H7V10H5V5M14,5H19V10H17V7H14V5M17,14H19V19H14V17H17V14M10,17V19H5V14H7V17H10Z"/> </vector> libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/MaximizeButtonView.kt +6 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.wm.shell.windowdecor import android.animation.AnimatorSet import android.animation.ObjectAnimator import android.animation.ValueAnimator import android.annotation.DrawableRes import android.content.Context import android.content.res.ColorStateList import android.graphics.Color Loading Loading @@ -132,6 +133,11 @@ class MaximizeButtonView( } } /** Set the drawable resource to use for the maximize button. */ fun setIcon(@DrawableRes icon: Int) { maximizeWindow.setImageResource(icon) } companion object { private const val OPACITY_15 = 38 } Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/extension/TaskInfo.kt +8 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.app.TaskInfo import android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN import android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW import android.app.WindowConfiguration.WINDOWING_MODE_PINNED import android.view.WindowInsets import android.view.WindowInsetsController.APPEARANCE_LIGHT_CAPTION_BARS import android.view.WindowInsetsController.APPEARANCE_TRANSPARENT_CAPTION_BAR_BACKGROUND Loading @@ -46,3 +47,10 @@ val TaskInfo.isPinned: Boolean /** Whether the task is in multi-window windowing mode. */ val TaskInfo.isMultiWindow: Boolean get() = windowingMode == WINDOWING_MODE_MULTI_WINDOW /** Whether the task is requesting immersive mode. */ val TaskInfo.requestingImmersive: Boolean get() { // Considered to be requesting immersive when requesting to hide the status bar. return (requestedVisibleTypes and WindowInsets.Type.statusBars()) == 0 } libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/AppHeaderViewHolder.kt +20 −9 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ import com.android.internal.R.attr.materialColorSecondaryContainer import com.android.internal.R.attr.materialColorSurfaceContainerHigh import com.android.internal.R.attr.materialColorSurfaceContainerLow import com.android.internal.R.attr.materialColorSurfaceDim import com.android.window.flags.Flags import com.android.window.flags.Flags.enableMinimizeButton import com.android.wm.shell.R import android.window.flags.DesktopModeFlags Loading @@ -59,6 +60,7 @@ import com.android.wm.shell.windowdecor.common.OPACITY_65 import com.android.wm.shell.windowdecor.common.Theme import com.android.wm.shell.windowdecor.extension.isLightCaptionBarAppearance import com.android.wm.shell.windowdecor.extension.isTransparentCaptionBarAppearance import com.android.wm.shell.windowdecor.extension.requestingImmersive /** * A desktop mode window decoration used when the window is floating (i.e. freeform). It hosts Loading Loading @@ -241,7 +243,8 @@ class AppHeaderViewHolder( } minimizeWindowButton.isGone = !enableMinimizeButton() // Maximize button. maximizeButtonView.setAnimationTints( maximizeButtonView.apply { setAnimationTints( darkMode = header.appTheme == Theme.DARK, iconForegroundColor = colorStateList, baseForegroundColor = foregroundColor, Loading @@ -251,6 +254,14 @@ class AppHeaderViewHolder( drawableInsets = maximizeDrawableInsets ) ) setIcon( if (taskInfo.requestingImmersive && Flags.enableFullyImmersiveInDesktop()) { R.drawable.decor_desktop_mode_immersive_button_dark } else { R.drawable.decor_desktop_mode_maximize_button_dark } ) } // Close button. closeWindowButton.apply { imageTintList = colorStateList Loading Loading
core/java/android/app/TaskInfo.java +12 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import android.os.Build; import android.os.IBinder; import android.os.Parcel; import android.view.DisplayCutout; import android.view.WindowInsets; import android.window.WindowContainerToken; import java.util.ArrayList; Loading Loading @@ -328,6 +329,13 @@ public class TaskInfo { */ public long capturedLinkTimestamp; /** * The requested visible types of insets. * @hide */ @WindowInsets.Type.InsetsType public int requestedVisibleTypes; /** * Encapsulate specific App Compat information. * @hide Loading Loading @@ -465,6 +473,7 @@ public class TaskInfo { && lastNonFullscreenBounds == this.lastNonFullscreenBounds && Objects.equals(capturedLink, that.capturedLink) && capturedLinkTimestamp == that.capturedLinkTimestamp && requestedVisibleTypes == that.requestedVisibleTypes && appCompatTaskInfo.equalsForTaskOrganizer(that.appCompatTaskInfo); } Loading Loading @@ -539,6 +548,7 @@ public class TaskInfo { lastNonFullscreenBounds = source.readTypedObject(Rect.CREATOR); capturedLink = source.readTypedObject(Uri.CREATOR); capturedLinkTimestamp = source.readLong(); requestedVisibleTypes = source.readInt(); appCompatTaskInfo = source.readTypedObject(AppCompatTaskInfo.CREATOR); } Loading Loading @@ -591,6 +601,7 @@ public class TaskInfo { dest.writeTypedObject(lastNonFullscreenBounds, flags); dest.writeTypedObject(capturedLink, flags); dest.writeLong(capturedLinkTimestamp); dest.writeInt(requestedVisibleTypes); dest.writeTypedObject(appCompatTaskInfo, flags); } Loading Loading @@ -633,6 +644,7 @@ public class TaskInfo { + " lastNonFullscreenBounds=" + lastNonFullscreenBounds + " capturedLink=" + capturedLink + " capturedLinkTimestamp=" + capturedLinkTimestamp + " requestedVisibleTypes=" + requestedVisibleTypes + " appCompatTaskInfo=" + appCompatTaskInfo + "}"; } Loading
libs/WindowManager/Shell/res/drawable/decor_desktop_mode_immersive_button_dark.xml 0 → 100644 +25 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2024 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:width="24dp" android:viewportWidth="24" android:viewportHeight="24"> <path android:fillColor="#000000" android:pathData="M5,5H10V7H7V10H5V5M14,5H19V10H17V7H14V5M17,14H19V19H14V17H17V14M10,17V19H5V14H7V17H10Z"/> </vector>
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/MaximizeButtonView.kt +6 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.wm.shell.windowdecor import android.animation.AnimatorSet import android.animation.ObjectAnimator import android.animation.ValueAnimator import android.annotation.DrawableRes import android.content.Context import android.content.res.ColorStateList import android.graphics.Color Loading Loading @@ -132,6 +133,11 @@ class MaximizeButtonView( } } /** Set the drawable resource to use for the maximize button. */ fun setIcon(@DrawableRes icon: Int) { maximizeWindow.setImageResource(icon) } companion object { private const val OPACITY_15 = 38 } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/extension/TaskInfo.kt +8 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.app.TaskInfo import android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN import android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW import android.app.WindowConfiguration.WINDOWING_MODE_PINNED import android.view.WindowInsets import android.view.WindowInsetsController.APPEARANCE_LIGHT_CAPTION_BARS import android.view.WindowInsetsController.APPEARANCE_TRANSPARENT_CAPTION_BAR_BACKGROUND Loading @@ -46,3 +47,10 @@ val TaskInfo.isPinned: Boolean /** Whether the task is in multi-window windowing mode. */ val TaskInfo.isMultiWindow: Boolean get() = windowingMode == WINDOWING_MODE_MULTI_WINDOW /** Whether the task is requesting immersive mode. */ val TaskInfo.requestingImmersive: Boolean get() { // Considered to be requesting immersive when requesting to hide the status bar. return (requestedVisibleTypes and WindowInsets.Type.statusBars()) == 0 }
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/AppHeaderViewHolder.kt +20 −9 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ import com.android.internal.R.attr.materialColorSecondaryContainer import com.android.internal.R.attr.materialColorSurfaceContainerHigh import com.android.internal.R.attr.materialColorSurfaceContainerLow import com.android.internal.R.attr.materialColorSurfaceDim import com.android.window.flags.Flags import com.android.window.flags.Flags.enableMinimizeButton import com.android.wm.shell.R import android.window.flags.DesktopModeFlags Loading @@ -59,6 +60,7 @@ import com.android.wm.shell.windowdecor.common.OPACITY_65 import com.android.wm.shell.windowdecor.common.Theme import com.android.wm.shell.windowdecor.extension.isLightCaptionBarAppearance import com.android.wm.shell.windowdecor.extension.isTransparentCaptionBarAppearance import com.android.wm.shell.windowdecor.extension.requestingImmersive /** * A desktop mode window decoration used when the window is floating (i.e. freeform). It hosts Loading Loading @@ -241,7 +243,8 @@ class AppHeaderViewHolder( } minimizeWindowButton.isGone = !enableMinimizeButton() // Maximize button. maximizeButtonView.setAnimationTints( maximizeButtonView.apply { setAnimationTints( darkMode = header.appTheme == Theme.DARK, iconForegroundColor = colorStateList, baseForegroundColor = foregroundColor, Loading @@ -251,6 +254,14 @@ class AppHeaderViewHolder( drawableInsets = maximizeDrawableInsets ) ) setIcon( if (taskInfo.requestingImmersive && Flags.enableFullyImmersiveInDesktop()) { R.drawable.decor_desktop_mode_immersive_button_dark } else { R.drawable.decor_desktop_mode_maximize_button_dark } ) } // Close button. closeWindowButton.apply { imageTintList = colorStateList Loading