Revert change "Change Rounded corner overlay to be in Overlay layer"

Revert CL ag/18494304

Reason: Memory regression on certain devices (b/235601833)
Bug: 235601833
Bug: 225505986
Test: manual
Merged-In: Iddc0f36739ec1579e31edec314e9509c3c70edfb
Change-Id: Iddc0f36739ec1579e31edec314e9509c3c70edfb
(cherry picked from commit f62e001347)
This commit is contained in:
Vaibhav Devmurari
2022-06-30 17:11:55 +00:00
committed by Shawn Lin
parent c96c0a8275
commit 6af81a2bd6
7 changed files with 6 additions and 22 deletions

View File

@@ -27,8 +27,6 @@ import android.view.InputWindowHandle;
import android.view.SurfaceControl; import android.view.SurfaceControl;
import android.view.WindowManager; import android.view.WindowManager;
import com.android.server.policy.WindowManagerPolicy;
/** /**
* An internal implementation of an {@link InputMonitor} that uses a spy window. * An internal implementation of an {@link InputMonitor} that uses a spy window.
* *
@@ -69,9 +67,7 @@ class GestureMonitorSpyWindow {
final SurfaceControl.Transaction t = new SurfaceControl.Transaction(); final SurfaceControl.Transaction t = new SurfaceControl.Transaction();
t.setInputWindowInfo(mInputSurface, mWindowHandle); t.setInputWindowInfo(mInputSurface, mWindowHandle);
// Gesture monitor should be above handwriting event surface, hence setting it to t.setLayer(mInputSurface, Integer.MAX_VALUE);
// WindowManagerPolicy.INPUT_DISPLAY_OVERLAY_LAYER + 1
t.setLayer(mInputSurface, WindowManagerPolicy.INPUT_DISPLAY_OVERLAY_LAYER + 1);
t.setPosition(mInputSurface, 0, 0); t.setPosition(mInputSurface, 0, 0);
t.setCrop(mInputSurface, null /* crop to parent surface */); t.setCrop(mInputSurface, null /* crop to parent surface */);
t.show(mInputSurface); t.show(mInputSurface);

View File

@@ -27,8 +27,6 @@ import android.view.InputWindowHandle;
import android.view.SurfaceControl; import android.view.SurfaceControl;
import android.view.WindowManager; import android.view.WindowManager;
import com.android.server.policy.WindowManagerPolicy;
final class HandwritingEventReceiverSurface { final class HandwritingEventReceiverSurface {
public static final String TAG = HandwritingEventReceiverSurface.class.getSimpleName(); public static final String TAG = HandwritingEventReceiverSurface.class.getSimpleName();
@@ -38,8 +36,7 @@ final class HandwritingEventReceiverSurface {
// is above gesture monitors, then edge-back and swipe-up gestures won't work when this surface // is above gesture monitors, then edge-back and swipe-up gestures won't work when this surface
// is intercepting. // is intercepting.
// TODO(b/217538817): Specify the ordering in WM by usage. // TODO(b/217538817): Specify the ordering in WM by usage.
private static final int HANDWRITING_SURFACE_LAYER = private static final int HANDWRITING_SURFACE_LAYER = Integer.MAX_VALUE - 1;
WindowManagerPolicy.INPUT_DISPLAY_OVERLAY_LAYER;
private final InputWindowHandle mWindowHandle; private final InputWindowHandle mWindowHandle;
private final InputChannel mClientChannel; private final InputChannel mClientChannel;

View File

@@ -156,10 +156,6 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants {
int FINISH_LAYOUT_REDO_ANIM = 0x0008; int FINISH_LAYOUT_REDO_ANIM = 0x0008;
/** Layer for the screen off animation */ /** Layer for the screen off animation */
int COLOR_FADE_LAYER = 0x40000001; int COLOR_FADE_LAYER = 0x40000001;
/** Layer for Input overlays for capturing inputs for gesture detection, etc. */
int INPUT_DISPLAY_OVERLAY_LAYER = 0x7f000000;
/** Layer for Screen Decoration: The top most visible layer just below input overlay layers */
int SCREEN_DECOR_DISPLAY_OVERLAY_LAYER = INPUT_DISPLAY_OVERLAY_LAYER - 1;
/** /**
* Register shortcuts for window manager to dispatch. * Register shortcuts for window manager to dispatch.

View File

@@ -265,7 +265,7 @@ final class InputManagerCallback implements InputManagerService.WindowManagerCal
.setContainerLayer() .setContainerLayer()
.setName(name) .setName(name)
.setCallsite("createSurfaceForGestureMonitor") .setCallsite("createSurfaceForGestureMonitor")
.setParent(dc.getOverlayLayer()) .setParent(dc.getSurfaceControl())
.build(); .build();
} }
} }

View File

@@ -173,11 +173,6 @@ class ScreenRotationAnimation {
if (isSizeChanged) { if (isSizeChanged) {
mRoundedCornerOverlay = displayContent.findRoundedCornerOverlays(); mRoundedCornerOverlay = displayContent.findRoundedCornerOverlays();
} else {
// Exclude rounded corner overlay from screenshot buffer. Rounded
// corner overlay windows are un-rotated during rotation animation
// for a seamless transition.
builder.setExcludeLayers(displayContent.findRoundedCornerOverlays());
} }
SurfaceControl.ScreenshotHardwareBuffer screenshotBuffer = SurfaceControl.ScreenshotHardwareBuffer screenshotBuffer =

View File

@@ -8215,7 +8215,7 @@ public class WindowManagerService extends IWindowManager.Stub
.setContainerLayer() .setContainerLayer()
.setName("IME Handwriting Surface") .setName("IME Handwriting Surface")
.setCallsite("getHandwritingSurfaceForDisplay") .setCallsite("getHandwritingSurfaceForDisplay")
.setParent(dc.getOverlayLayer()) .setParent(dc.getSurfaceControl())
.build(); .build();
} }
} }

View File

@@ -368,7 +368,7 @@ class WindowToken extends WindowContainer<WindowState> {
super.assignRelativeLayer(t, super.assignRelativeLayer(t,
mDisplayContent.getDefaultTaskDisplayArea().getSplitScreenDividerAnchor(), 1); mDisplayContent.getDefaultTaskDisplayArea().getSplitScreenDividerAnchor(), 1);
} else if (mRoundedCornerOverlay) { } else if (mRoundedCornerOverlay) {
super.assignLayer(t, WindowManagerPolicy.SCREEN_DECOR_DISPLAY_OVERLAY_LAYER); super.assignLayer(t, WindowManagerPolicy.COLOR_FADE_LAYER + 1);
} else { } else {
super.assignLayer(t, layer); super.assignLayer(t, layer);
} }
@@ -378,7 +378,7 @@ class WindowToken extends WindowContainer<WindowState> {
SurfaceControl.Builder makeSurface() { SurfaceControl.Builder makeSurface() {
final SurfaceControl.Builder builder = super.makeSurface(); final SurfaceControl.Builder builder = super.makeSurface();
if (mRoundedCornerOverlay) { if (mRoundedCornerOverlay) {
builder.setParent(getDisplayContent().getOverlayLayer()); builder.setParent(null);
} }
return builder; return builder;
} }