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

Commit 8065f440 authored by chaviw's avatar chaviw
Browse files

Allow Windows in Display Overlays

Instead of display overlays being a SurfaceControl that can only have
child surfaces, it now is a WindowContainer that can have windows.
Specifically, windows with the type TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY
will be placed in the display overlays layer

This is the first step to allow window magnification to use real windows
on the display.

Test: go/wm-smoke
Bug: 136250281

Change-Id: Idad98db7a85f68ba49557c0efb83b9a1be089609
parent 0bfdf247
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1105,6 +1105,13 @@ public interface WindowManager extends ViewManager {
         */
        public static final int TYPE_APPLICATION_OVERLAY = FIRST_SYSTEM_WINDOW + 38;

        /**
         * Window type: Window for adding accessibility window magnification above other windows.
         * This will place the window in the overlay windows.
         * @hide
         */
        public static final int TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY = FIRST_SYSTEM_WINDOW + 39;

        /**
         * End of types of system windows.
         */
+1 −0
Original line number Diff line number Diff line
@@ -163,6 +163,7 @@ message DisplayContentProto {
    repeated IdentifierProto opening_apps = 17;
    repeated IdentifierProto closing_apps = 18;
    repeated IdentifierProto changing_apps = 19;
    repeated WindowTokenProto overlay_windows = 20;
}

/* represents DisplayFrames */
+6 −3
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.server.policy;

import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW;
import static android.view.WindowManager.LayoutParams.LAST_APPLICATION_WINDOW;
import static android.view.WindowManager.LayoutParams.TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY;
import static android.view.WindowManager.LayoutParams.TYPE_ACCESSIBILITY_OVERLAY;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_ABOVE_SUB_PANEL;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG;
@@ -876,13 +877,15 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants {
            case TYPE_ACCESSIBILITY_OVERLAY:
                // overlay put by accessibility services to intercept user interaction
                return  30;
            case TYPE_SECURE_SYSTEM_OVERLAY:
            case TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY:
                return 31;
            case TYPE_BOOT_PROGRESS:
            case TYPE_SECURE_SYSTEM_OVERLAY:
                return  32;
            case TYPE_BOOT_PROGRESS:
                return  33;
            case TYPE_POINTER:
                // the (mouse) pointer layer
                return  33;
                return  34;
            default:
                Slog.e("WindowManager", "Unknown window type: " + type);
                return APPLICATION_LAYER;
+208 −180

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -172,7 +172,7 @@ class ScreenRotationAnimation {
                    .setContainerLayer()
                    .build();

            mSurfaceControl = displayContent.makeSurface(null)
            mSurfaceControl = mService.makeSurfaceBuilder(null)
                    .setName("ScreenshotSurface")
                    .setParent(mRotationLayer)
                    .setBufferSize(mWidth, mHeight)
Loading