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
diff --git a/core/java/com/android/internal/jank/Cuj.java b/core/java/com/android/internal/jank/Cuj.java
index bbb145d..bc1071e 100644
--- a/core/java/com/android/internal/jank/Cuj.java
+++ b/core/java/com/android/internal/jank/Cuj.java
@@ -432,15 +432,8 @@
      */
     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 @@
             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 @@
         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 @@
                 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";
     }
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java
index ee02c02..8d3ad66 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java
@@ -991,9 +991,7 @@
             @ShellMainThread ShellExecutor mainExecutor,
             DesktopState desktopState,
             ShellInit shellInit,
-            ShellController shellController,
-            InteractionJankMonitor interactionJankMonitor
-    ) {
+            ShellController shellController) {
         return new DesktopTilingDecorViewModel(
                 context,
                 mainDispatcher,
@@ -1012,8 +1010,7 @@
                 mainExecutor,
                 desktopState,
                 shellInit,
-                shellController,
-                interactionJankMonitor
+                shellController
         );
     }
 
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingDecorViewModel.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingDecorViewModel.kt
index 09d07b8..679aa6f 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingDecorViewModel.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingDecorViewModel.kt
@@ -28,7 +28,6 @@
 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 @@
     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 @@
                             mainExecutor,
                             desktopState,
                             shellController,
-                            interactionJankMonitor,
                         )
                         .also { userHandlerList[deskId] = it }
                 }
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingDividerWindowManager.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingDividerWindowManager.kt
index 6cea7e7..8c810ab 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingDividerWindowManager.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingDividerWindowManager.kt
@@ -41,10 +41,7 @@
 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 @@
     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 @@
 
     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 @@
      */
     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 @@
     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)
     }
 }
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingWindowDecoration.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingWindowDecoration.kt
index 04f577d..9f9f71f 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingWindowDecoration.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingWindowDecoration.kt
@@ -38,7 +38,6 @@
 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 @@
     @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 @@
                     dividerBounds,
                     displayContext,
                     isDarkMode,
-                    interactionJankMonitor
                 )
             }
         // a leash to present the divider on top of, without re-parenting.
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingDecorViewModelTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingDecorViewModelTest.kt
index 5d1b453..bcf868f 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingDecorViewModelTest.kt
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingDecorViewModelTest.kt
@@ -22,7 +22,6 @@
 import android.testing.AndroidTestingRunner
 import android.util.SparseArray
 import androidx.test.filters.SmallTest
-import com.android.internal.jank.InteractionJankMonitor
 import com.android.wm.shell.RootTaskDisplayAreaOrganizer
 import com.android.wm.shell.ShellTaskOrganizer
 import com.android.wm.shell.ShellTestCase
@@ -91,7 +90,6 @@
     private val shellInit: ShellInit = mock()
     private val shellController: ShellController = mock()
     private val configuration: Configuration = mock()
-    private val jankMonitor: InteractionJankMonitor = mock()
     private lateinit var desktopTilingDecorViewModel: DesktopTilingDecorViewModel
     @Captor private lateinit var callbackCaptor: ArgumentCaptor<Runnable>
 
@@ -118,7 +116,6 @@
                 desktopState,
                 shellInit,
                 shellController,
-                jankMonitor,
             )
         whenever(contextMock.createContextAsUser(any(), any())).thenReturn(contextMock)
         whenever(displayControllerMock.getDisplayLayout(any())).thenReturn(displayLayout)
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingDividerWindowManagerTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingDividerWindowManagerTest.kt
index 6742b04..7083147 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingDividerWindowManagerTest.kt
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingDividerWindowManagerTest.kt
@@ -22,8 +22,6 @@
 import android.view.SurfaceControl
 import androidx.test.annotation.UiThreadTest
 import androidx.test.filters.SmallTest
-import com.android.internal.jank.Cuj.CUJ_DESKTOP_MODE_TILE_RESIZING
-import com.android.internal.jank.InteractionJankMonitor
 import com.android.wm.shell.ShellTestCase
 import java.util.function.Supplier
 import kotlin.test.Test
@@ -55,8 +53,6 @@
 
     private lateinit var desktopTilingWindowManager: DesktopTilingDividerWindowManager
 
-    private val jankMonitor: InteractionJankMonitor = mock()
-
     @Before
     fun setup() {
         config = Configuration()
@@ -78,7 +74,6 @@
                 BOUNDS,
                 mContext,
                 /* isDarkMode= */ true,
-                jankMonitor,
             )
     }
 
@@ -97,19 +92,6 @@
 
     @Test
     @UiThreadTest
-    fun dividerMove_beginsAndEndsJankMonitoring() {
-        desktopTilingWindowManager.generateViewHost(surfaceControl)
-        desktopTilingWindowManager.onDividerMoveStart(-1, mock())
-
-        verify(jankMonitor, times(1)).begin(any())
-
-        desktopTilingWindowManager.onDividerMovedEnd(-1, mock())
-
-        verify(jankMonitor, times(1)).end(CUJ_DESKTOP_MODE_TILE_RESIZING)
-    }
-
-    @Test
-    @UiThreadTest
     fun testWindowManager_accountsForRoundedCornerDimensions() {
         desktopTilingWindowManager.generateViewHost(surfaceControl)
         val cornerRadius =
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingWindowDecorationTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingWindowDecorationTest.kt
index 1420286..5382748 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingWindowDecorationTest.kt
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingWindowDecorationTest.kt
@@ -32,7 +32,6 @@
 import android.window.TransitionInfo.Change
 import android.window.WindowContainerTransaction
 import androidx.test.filters.SmallTest
-import com.android.internal.jank.InteractionJankMonitor
 import com.android.wm.shell.RootTaskDisplayAreaOrganizer
 import com.android.wm.shell.ShellTaskOrganizer
 import com.android.wm.shell.ShellTestCase
@@ -120,7 +119,6 @@
     private val shellController: ShellController = mock()
     private val mainExecutor: ShellExecutor = mock()
     private val configuration: Configuration = mock()
-    private val jankMonitor: InteractionJankMonitor = mock()
     private lateinit var tilingDecoration: DesktopTilingWindowDecoration
     private lateinit var desktopState: FakeDesktopState
 
@@ -154,7 +152,6 @@
                 mainExecutor,
                 desktopState,
                 shellController,
-                jankMonitor,
             )
         whenever(context.createContextAsUser(any(), any())).thenReturn(context)
         whenever(userRepositories.current).thenReturn(desktopRepository)