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

Commit a0c0e6d1 authored by Priyanka Advani (xWF)'s avatar Priyanka Advani (xWF) Committed by Android (Google) Code Review
Browse files

Revert "Add tiling jank CUJ."

Revert submission 34172454-jank_cuj

Reason for revert: Droidmonitor created revert due to b/430040827. Will be verifying through ABTD before submission.

Fix: 430040827

Reverted changes: /q/submissionid:34172454-jank_cuj

Change-Id: I4a46812ddf8c0de084fe9b9b4507f09fc2fb9287
parent 19b6a258
Loading
Loading
Loading
Loading
+2 −13
Original line number Diff line number Diff line
@@ -432,15 +432,8 @@ public class Cuj {
     */
    public static final int CUJ_LAUNCHER_OVERVIEW_CLEAR_ALL = 139;

    /**
     * Track when tile resizing divider is simultaneously resizing apps.
     *
     * <p> Tracking starts when the divider move handle is dragged and ends when the drag ends.
     */
    public static final int CUJ_DESKTOP_MODE_TILE_RESIZING = 140;

    // When adding a CUJ, update this and make sure to also update CUJ_TO_STATSD_INTERACTION_TYPE.
    @VisibleForTesting static final int LAST_CUJ = CUJ_DESKTOP_MODE_TILE_RESIZING;
    @VisibleForTesting static final int LAST_CUJ = CUJ_LAUNCHER_OVERVIEW_CLEAR_ALL;

    /** @hide */
    @IntDef({
@@ -571,8 +564,7 @@ public class Cuj {
            CUJ_WEAR_QSS_TRAY_OPEN,
            CUJ_WEAR_NOTIFICATION_TRAY_OPEN,
            CUJ_DESKTOP_MODE_SHADE_WINDOW_DISPLAY_CHANGE,
            CUJ_LAUNCHER_OVERVIEW_CLEAR_ALL,
            CUJ_DESKTOP_MODE_TILE_RESIZING,
            CUJ_LAUNCHER_OVERVIEW_CLEAR_ALL
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface CujType {}
@@ -714,7 +706,6 @@ public class Cuj {
        CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_WEAR_NOTIFICATION_TRAY_OPEN] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__WEAR_NOTIFICATION_TRAY_OPEN;
        CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_DESKTOP_MODE_SHADE_WINDOW_DISPLAY_CHANGE] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__DESKTOP_MODE_SHADE_WINDOW_DISPLAY_CHANGE;
        CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_OVERVIEW_CLEAR_ALL] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_OVERVIEW_CLEAR_ALL;
        CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_DESKTOP_MODE_TILE_RESIZING] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__DESKTOP_MODE_TILE_RESIZING;
    }

    private Cuj() {
@@ -989,8 +980,6 @@ public class Cuj {
                return "DESKTOP_MODE_SHADE_WINDOW_DISPLAY_CHANGE";
            case CUJ_LAUNCHER_OVERVIEW_CLEAR_ALL:
                return "LAUNCHER_OVERVIEW_CLEAR_ALL";
            case CUJ_DESKTOP_MODE_TILE_RESIZING:
                return "CUJ_DESKTOP_MODE_TILE_RESIZING";
        }
        return "UNKNOWN";
    }
+2 −5
Original line number Diff line number Diff line
@@ -991,9 +991,7 @@ public abstract class WMShellModule {
            @ShellMainThread ShellExecutor mainExecutor,
            DesktopState desktopState,
            ShellInit shellInit,
            ShellController shellController,
            InteractionJankMonitor interactionJankMonitor
    ) {
            ShellController shellController) {
        return new DesktopTilingDecorViewModel(
                context,
                mainDispatcher,
@@ -1012,8 +1010,7 @@ public abstract class WMShellModule {
                mainExecutor,
                desktopState,
                shellInit,
                shellController,
                interactionJankMonitor
                shellController
        );
    }

+0 −3
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ import androidx.core.util.getOrElse
import androidx.core.util.keyIterator
import androidx.core.util.valueIterator
import com.android.internal.annotations.VisibleForTesting
import com.android.internal.jank.InteractionJankMonitor
import com.android.internal.protolog.ProtoLog
import com.android.wm.shell.R
import com.android.wm.shell.RootTaskDisplayAreaOrganizer
@@ -75,7 +74,6 @@ class DesktopTilingDecorViewModel(
    private val desktopState: DesktopState,
    private val shellInit: ShellInit,
    private val shellController: ShellController,
    private val interactionJankMonitor: InteractionJankMonitor,
) : DisplayChangeController.OnDisplayChangingListener {
    @VisibleForTesting
    var tilingHandlerByUserAndDeskId = SparseArray<SparseArray<DesktopTilingWindowDecoration>>()
@@ -125,7 +123,6 @@ class DesktopTilingDecorViewModel(
                            mainExecutor,
                            desktopState,
                            shellController,
                            interactionJankMonitor,
                        )
                        .also { userHandlerList[deskId] = it }
                }
+0 −21
Original line number Diff line number Diff line
@@ -41,10 +41,7 @@ import android.view.WindowManager.LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION
import android.view.WindowManager.LayoutParams.PRIVATE_FLAG_TRUSTED_OVERLAY
import android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER
import android.view.WindowlessWindowManager
import com.android.internal.jank.Cuj.CUJ_DESKTOP_MODE_TILE_RESIZING
import com.android.internal.jank.InteractionJankMonitor
import com.android.wm.shell.R
import java.util.concurrent.TimeUnit
import java.util.function.Supplier

/**
@@ -60,7 +57,6 @@ class DesktopTilingDividerWindowManager(
    private var dividerBounds: Rect,
    private val displayContext: Context,
    private val isDarkMode: Boolean,
    private val interactionJankMonitor: InteractionJankMonitor,
) : WindowlessWindowManager(config, leash, null), DividerMoveCallback, View.OnLayoutChangeListener {
    private lateinit var viewHost: SurfaceControlViewHost
    private var tilingDividerView: TilingDividerView? = null
@@ -263,22 +259,9 @@ class DesktopTilingDividerWindowManager(

    override fun onDividerMoveStart(pos: Int, motionEvent: MotionEvent) {
        setSlippery(false)
        beginJankMonitoring()
        transitionHandler.onDividerHandleDragStart(motionEvent)
    }

    private fun beginJankMonitoring() {
        val dividerView = tilingDividerView ?: return
        interactionJankMonitor.begin(
            InteractionJankMonitor.Configuration.Builder.withView(CUJ_DESKTOP_MODE_TILE_RESIZING, dividerView)
                .setTimeout(LONG_CUJ_TIMEOUT_MS)
        )
    }

    private fun endJankMonitoring() {
        interactionJankMonitor.end(CUJ_DESKTOP_MODE_TILE_RESIZING)
    }

    /**
     * Moves the divider view to a new position after touch, gets called from the
     * [TilingDividerView] onTouch function.
@@ -297,7 +280,6 @@ class DesktopTilingDividerWindowManager(
     */
    override fun onDividerMovedEnd(pos: Int, motionEvent: MotionEvent) {
        setSlippery(true)
        endJankMonitoring()
        val t = transactionSupplier.get()
        t.setPosition(leash, pos.toFloat() - maxRoundedCornerRadius, dividerBounds.top.toFloat())
        val dividerWidth = dividerBounds.width()
@@ -380,8 +362,5 @@ class DesktopTilingDividerWindowManager(
    companion object {
        private const val DIVIDER_FADE_IN_ALPHA_DURATION = 300L
        private const val DIVIDER_FADE_IN_ALPHA_SLOW_DURATION = 900L
        // Timeout used for resize and drag CUJs, this is longer than the default timeout to avoid
        // timing out in the middle of a resize or drag action.
        private val LONG_CUJ_TIMEOUT_MS = TimeUnit.SECONDS.toMillis(10L)
    }
}
+0 −3
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@ import android.window.TransitionInfo.Change
import android.window.TransitionRequestInfo
import android.window.WindowContainerTransaction
import com.android.internal.annotations.VisibleForTesting
import com.android.internal.jank.InteractionJankMonitor
import com.android.launcher3.icons.BaseIconFactory
import com.android.wm.shell.R
import com.android.wm.shell.RootTaskDisplayAreaOrganizer
@@ -95,7 +94,6 @@ class DesktopTilingWindowDecoration(
    @ShellMainThread private val mainExecutor: ShellExecutor,
    private val desktopState: DesktopState,
    private val shellController: ShellController,
    private val interactionJankMonitor: InteractionJankMonitor,
    private val transactionSupplier: Supplier<Transaction> = Supplier { Transaction() },
) :
    Transitions.TransitionHandler,
@@ -266,7 +264,6 @@ class DesktopTilingWindowDecoration(
                    dividerBounds,
                    displayContext,
                    isDarkMode,
                    interactionJankMonitor
                )
            }
        // a leash to present the divider on top of, without re-parenting.
Loading