Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +16 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import android.graphics.Rect; import android.graphics.Region; import android.graphics.drawable.Drawable; import android.os.Handler; import android.os.Trace; import android.util.Log; import android.util.Size; import android.view.Choreographer; Loading Loading @@ -158,7 +159,9 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin mSyncQueue = syncQueue; mRootTaskDisplayAreaOrganizer = rootTaskDisplayAreaOrganizer; Trace.beginSection("DesktopModeWindowDecoration#loadAppInfo"); loadAppInfo(); Trace.endSection(); } void setCaptionListeners( Loading Loading @@ -204,6 +207,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin void relayout(ActivityManager.RunningTaskInfo taskInfo, SurfaceControl.Transaction startT, SurfaceControl.Transaction finishT, boolean applyStartTransactionOnDraw, boolean shouldSetTaskPositionAndCrop) { Trace.beginSection("DesktopModeWindowDecoration#relayout"); if (isHandleMenuActive()) { mHandleMenu.relayout(startT); } Loading @@ -215,16 +219,22 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin final SurfaceControl oldDecorationSurface = mDecorationContainerSurface; final WindowContainerTransaction wct = new WindowContainerTransaction(); Trace.beginSection("DesktopModeWindowDecoration#relayout-inner"); relayout(mRelayoutParams, startT, finishT, wct, oldRootView, mResult); Trace.endSection(); // After this line, mTaskInfo is up-to-date and should be used instead of taskInfo Trace.beginSection("DesktopModeWindowDecoration#relayout-applyWCT"); mTaskOrganizer.applyTransaction(wct); Trace.endSection(); if (mResult.mRootView == null) { // This means something blocks the window decor from showing, e.g. the task is hidden. // Nothing is set up in this case including the decoration surface. Trace.endSection(); // DesktopModeWindowDecoration#relayout return; } if (oldRootView != mResult.mRootView) { if (mRelayoutParams.mLayoutResId == R.layout.desktop_mode_focused_window_decor) { mWindowDecorViewHolder = new DesktopModeFocusedWindowDecorationViewHolder( Loading Loading @@ -252,7 +262,9 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin throw new IllegalArgumentException("Unexpected layout resource id"); } } Trace.beginSection("DesktopModeWindowDecoration#relayout-binding"); mWindowDecorViewHolder.bindData(mTaskInfo); Trace.endSection(); if (!mTaskInfo.isFocused) { closeHandleMenu(); Loading @@ -268,11 +280,13 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin updateExclusionRegion(); } closeDragResizeListener(); Trace.endSection(); // DesktopModeWindowDecoration#relayout return; } if (oldDecorationSurface != mDecorationContainerSurface || mDragResizeListener == null) { closeDragResizeListener(); Trace.beginSection("DesktopModeWindowDecoration#relayout-DragResizeInputListener"); mDragResizeListener = new DragResizeInputListener( mContext, mHandler, Loading @@ -283,6 +297,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin mSurfaceControlBuilderSupplier, mSurfaceControlTransactionSupplier, mDisplayController); Trace.endSection(); } final int touchSlop = ViewConfiguration.get(mResult.mRootView.getContext()) Loading @@ -307,6 +322,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin mMaximizeMenu.positionMenu(calculateMaximizeMenuPosition(), startT); } } Trace.endSection(); // DesktopModeWindowDecoration#relayout } @VisibleForTesting Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/ResizeVeil.java +3 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.graphics.Color; import android.graphics.PixelFormat; import android.graphics.PointF; import android.graphics.Rect; import android.os.Trace; import android.view.Display; import android.view.LayoutInflater; import android.view.SurfaceControl; Loading Loading @@ -135,6 +136,7 @@ public class ResizeVeil { // Display may not be available yet, skip this until then. return; } Trace.beginSection("ResizeVeil#setupResizeVeil"); mVeilSurface = mSurfaceControlBuilderFactory .create("Resize veil of Task=" + mTaskInfo.taskId) .setContainerLayer() Loading Loading @@ -179,6 +181,7 @@ public class ResizeVeil { mViewHost = mSurfaceControlViewHostFactory.create(mContext, mDisplay, wwm, "ResizeVeil"); mViewHost.setView(root, lp); Trace.endSection(); } private boolean obtainDisplayOrRegisterListener() { Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecoration.java +3 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import android.graphics.Point; import android.graphics.Rect; import android.graphics.Region; import android.os.Binder; import android.os.Trace; import android.view.Display; import android.view.InsetsSource; import android.view.InsetsState; Loading Loading @@ -378,6 +379,7 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> startT.unsetColor(mTaskSurface); } Trace.beginSection("CaptionViewHostLayout"); if (mCaptionWindowManager == null) { // Put caption under a container surface because ViewRootImpl sets the destination frame // of windowless window layers and BLASTBufferQueue#update() doesn't support offset. Loading Loading @@ -412,6 +414,7 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> } mViewHost.relayout(lp); } Trace.endSection(); // CaptionViewHostLayout } private Rect calculateBoundingRect(@NonNull OccludingCaptionElement element, Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +16 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import android.graphics.Rect; import android.graphics.Region; import android.graphics.drawable.Drawable; import android.os.Handler; import android.os.Trace; import android.util.Log; import android.util.Size; import android.view.Choreographer; Loading Loading @@ -158,7 +159,9 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin mSyncQueue = syncQueue; mRootTaskDisplayAreaOrganizer = rootTaskDisplayAreaOrganizer; Trace.beginSection("DesktopModeWindowDecoration#loadAppInfo"); loadAppInfo(); Trace.endSection(); } void setCaptionListeners( Loading Loading @@ -204,6 +207,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin void relayout(ActivityManager.RunningTaskInfo taskInfo, SurfaceControl.Transaction startT, SurfaceControl.Transaction finishT, boolean applyStartTransactionOnDraw, boolean shouldSetTaskPositionAndCrop) { Trace.beginSection("DesktopModeWindowDecoration#relayout"); if (isHandleMenuActive()) { mHandleMenu.relayout(startT); } Loading @@ -215,16 +219,22 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin final SurfaceControl oldDecorationSurface = mDecorationContainerSurface; final WindowContainerTransaction wct = new WindowContainerTransaction(); Trace.beginSection("DesktopModeWindowDecoration#relayout-inner"); relayout(mRelayoutParams, startT, finishT, wct, oldRootView, mResult); Trace.endSection(); // After this line, mTaskInfo is up-to-date and should be used instead of taskInfo Trace.beginSection("DesktopModeWindowDecoration#relayout-applyWCT"); mTaskOrganizer.applyTransaction(wct); Trace.endSection(); if (mResult.mRootView == null) { // This means something blocks the window decor from showing, e.g. the task is hidden. // Nothing is set up in this case including the decoration surface. Trace.endSection(); // DesktopModeWindowDecoration#relayout return; } if (oldRootView != mResult.mRootView) { if (mRelayoutParams.mLayoutResId == R.layout.desktop_mode_focused_window_decor) { mWindowDecorViewHolder = new DesktopModeFocusedWindowDecorationViewHolder( Loading Loading @@ -252,7 +262,9 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin throw new IllegalArgumentException("Unexpected layout resource id"); } } Trace.beginSection("DesktopModeWindowDecoration#relayout-binding"); mWindowDecorViewHolder.bindData(mTaskInfo); Trace.endSection(); if (!mTaskInfo.isFocused) { closeHandleMenu(); Loading @@ -268,11 +280,13 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin updateExclusionRegion(); } closeDragResizeListener(); Trace.endSection(); // DesktopModeWindowDecoration#relayout return; } if (oldDecorationSurface != mDecorationContainerSurface || mDragResizeListener == null) { closeDragResizeListener(); Trace.beginSection("DesktopModeWindowDecoration#relayout-DragResizeInputListener"); mDragResizeListener = new DragResizeInputListener( mContext, mHandler, Loading @@ -283,6 +297,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin mSurfaceControlBuilderSupplier, mSurfaceControlTransactionSupplier, mDisplayController); Trace.endSection(); } final int touchSlop = ViewConfiguration.get(mResult.mRootView.getContext()) Loading @@ -307,6 +322,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin mMaximizeMenu.positionMenu(calculateMaximizeMenuPosition(), startT); } } Trace.endSection(); // DesktopModeWindowDecoration#relayout } @VisibleForTesting Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/ResizeVeil.java +3 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.graphics.Color; import android.graphics.PixelFormat; import android.graphics.PointF; import android.graphics.Rect; import android.os.Trace; import android.view.Display; import android.view.LayoutInflater; import android.view.SurfaceControl; Loading Loading @@ -135,6 +136,7 @@ public class ResizeVeil { // Display may not be available yet, skip this until then. return; } Trace.beginSection("ResizeVeil#setupResizeVeil"); mVeilSurface = mSurfaceControlBuilderFactory .create("Resize veil of Task=" + mTaskInfo.taskId) .setContainerLayer() Loading Loading @@ -179,6 +181,7 @@ public class ResizeVeil { mViewHost = mSurfaceControlViewHostFactory.create(mContext, mDisplay, wwm, "ResizeVeil"); mViewHost.setView(root, lp); Trace.endSection(); } private boolean obtainDisplayOrRegisterListener() { Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecoration.java +3 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import android.graphics.Point; import android.graphics.Rect; import android.graphics.Region; import android.os.Binder; import android.os.Trace; import android.view.Display; import android.view.InsetsSource; import android.view.InsetsState; Loading Loading @@ -378,6 +379,7 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> startT.unsetColor(mTaskSurface); } Trace.beginSection("CaptionViewHostLayout"); if (mCaptionWindowManager == null) { // Put caption under a container surface because ViewRootImpl sets the destination frame // of windowless window layers and BLASTBufferQueue#update() doesn't support offset. Loading Loading @@ -412,6 +414,7 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> } mViewHost.relayout(lp); } Trace.endSection(); // CaptionViewHostLayout } private Rect calculateBoundingRect(@NonNull OccludingCaptionElement element, Loading