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

Commit a64e9a35 authored by Alp Yalcin's avatar Alp Yalcin
Browse files

Consolidate DESKTOP_MODE_INITIAL_BOUNDS_SCALE constant among...

Consolidate DESKTOP_MODE_INITIAL_BOUNDS_SCALE constant among DesktopTasksController and DesktopModeUtils.kt files

Use the constant from DesktopModeUtils.kt instead of the one in
DesktopTasksController.kt

Flag: EXEMPT constant replacement
Test: m
Bug: 434658423
Change-Id: I0fb1825673a3ecedb9590ddf614d08636db6c5ec
parent 51b84c48
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ import kotlin.math.ceil
import kotlin.math.max
import kotlin.math.min

@JvmField
val DESKTOP_MODE_INITIAL_BOUNDS_SCALE: Float =
    SystemProperties.getInt("persist.wm.debug.desktop_mode_initial_bounds_scale", 72) / 100f

+0 −5
Original line number Diff line number Diff line
@@ -5914,11 +5914,6 @@ class DesktopTasksController(
    }

    companion object {
        // TODO: b/434658423 - Consolidate below constant among DesktopModeUtils and this file.
        @JvmField
        val DESKTOP_MODE_INITIAL_BOUNDS_SCALE =
            SystemProperties.getInt("persist.wm.debug.desktop_mode_initial_bounds_scale", 72) / 100f

        // Timeout used for CUJ_DESKTOP_MODE_ENTER_APP_HANDLE_DRAG_HOLD, this is longer than the
        // default timeout to avoid timing out in the middle of a drag action.
        private val APP_HANDLE_DRAG_HOLD_CUJ_TIMEOUT_MS: Long = TimeUnit.SECONDS.toMillis(10L)
+1 −1
Original line number Diff line number Diff line
@@ -569,7 +569,7 @@ constructor(

                    IndicatorType.TO_DESKTOP_INDICATOR -> {
                        val adjustmentPercentage =
                            (1f - DesktopTasksController.DESKTOP_MODE_INITIAL_BOUNDS_SCALE)
                            (1f - DESKTOP_MODE_INITIAL_BOUNDS_SCALE)
                        return Rect(
                            (adjustmentPercentage * desktopStableBounds.width() / 2).toInt(),
                            (adjustmentPercentage * desktopStableBounds.height() / 2).toInt(),
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ import static android.util.RotationUtils.rotateBounds;
import static com.android.wm.shell.ShellTaskOrganizer.TASK_LISTENER_TYPE_PIP;
import static com.android.wm.shell.ShellTaskOrganizer.taskListenerTypeToString;
import static com.android.wm.shell.desktopmode.DesktopModeUtils.calculateInitialBounds;
import static com.android.wm.shell.desktopmode.DesktopTasksController.DESKTOP_MODE_INITIAL_BOUNDS_SCALE;
import static com.android.wm.shell.desktopmode.DesktopModeUtils.DESKTOP_MODE_INITIAL_BOUNDS_SCALE;
import static com.android.wm.shell.pip.PipAnimationController.TRANSITION_DIRECTION_EXPAND_OR_UNEXPAND;
import static com.android.wm.shell.pip.PipAnimationController.TRANSITION_DIRECTION_LEAVE_PIP;
import static com.android.wm.shell.pip.PipAnimationController.TRANSITION_DIRECTION_LEAVE_PIP_TO_SPLIT_SCREEN;