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

Commit e451ad62 authored by Sherry Zhou's avatar Sherry Zhou
Browse files

Rename LongPressHandlingView to TouchHandlingView

Test: manual test by pushing from SysUI Studio and mp droid
Bug: 394613258
Flag: NONE, rename some classes

Change-Id: I9326aeaa1cff0d625784177ebdd17ee455031acd
parent 9e87c396
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ import com.android.systemui.flags.Flags
import com.android.systemui.keyguard.ui.composable.blueprint.BlueprintAlignmentLines
import com.android.systemui.keyguard.ui.view.DeviceEntryIconView
import com.android.systemui.log.LogBuffer
import com.android.systemui.log.LongPressHandlingViewLogger
import com.android.systemui.log.TouchHandlingViewLogger
import com.android.systemui.log.dagger.LongPressTouchLog
import com.android.systemui.plugins.FalsingManager
import com.android.systemui.res.R
@@ -68,7 +68,7 @@ constructor(
                DeviceEntryIconView(
                        context,
                        null,
                        logger = LongPressHandlingViewLogger(logBuffer, tag = TAG),
                        logger = TouchHandlingViewLogger(logBuffer, tag = TAG),
                    )
                    .apply {
                        id = R.id.device_entry_icon_view
+2 −2
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ import com.android.systemui.keyguard.ui.view.DeviceEntryIconView
import com.android.systemui.keyguard.ui.viewmodel.AlternateBouncerDependencies
import com.android.systemui.keyguard.ui.viewmodel.AlternateBouncerMessageAreaViewModel
import com.android.systemui.keyguard.ui.viewmodel.AlternateBouncerUdfpsIconViewModel
import com.android.systemui.log.LongPressHandlingViewLogger
import com.android.systemui.log.TouchHandlingViewLogger
import com.android.systemui.res.R

@Composable
@@ -156,7 +156,7 @@ private fun StatusMessage(
@Composable
private fun DeviceEntryIcon(
    viewModel: AlternateBouncerUdfpsIconViewModel,
    logger: LongPressHandlingViewLogger,
    logger: TouchHandlingViewLogger,
    modifier: Modifier = Modifier,
) {
    AndroidView(
+2 −2
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ import com.android.systemui.keyguard.ui.viewmodel.DeviceEntryBackgroundViewModel
import com.android.systemui.keyguard.ui.viewmodel.DeviceEntryForegroundViewModel
import com.android.systemui.keyguard.ui.viewmodel.DeviceEntryIconViewModel
import com.android.systemui.log.LogBuffer
import com.android.systemui.log.LongPressHandlingViewLogger
import com.android.systemui.log.TouchHandlingViewLogger
import com.android.systemui.log.dagger.LongPressTouchLog
import com.android.systemui.plugins.FalsingManager
import com.android.systemui.res.R
@@ -74,7 +74,7 @@ constructor(
                DeviceEntryIconView(
                        context,
                        null,
                        logger = LongPressHandlingViewLogger(logBuffer, tag = TAG),
                        logger = TouchHandlingViewLogger(logBuffer, tag = TAG),
                    )
                    .apply {
                        id = R.id.device_entry_icon_view
+7 −7
Original line number Diff line number Diff line
@@ -21,10 +21,10 @@ import android.view.ViewConfiguration
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.common.ui.view.LongPressHandlingViewInteractionHandler.MotionEventModel
import com.android.systemui.common.ui.view.LongPressHandlingViewInteractionHandler.MotionEventModel.Down
import com.android.systemui.common.ui.view.LongPressHandlingViewInteractionHandler.MotionEventModel.Move
import com.android.systemui.common.ui.view.LongPressHandlingViewInteractionHandler.MotionEventModel.Up
import com.android.systemui.common.ui.view.TouchHandlingViewInteractionHandler.MotionEventModel
import com.android.systemui.common.ui.view.TouchHandlingViewInteractionHandler.MotionEventModel.Down
import com.android.systemui.common.ui.view.TouchHandlingViewInteractionHandler.MotionEventModel.Move
import com.android.systemui.common.ui.view.TouchHandlingViewInteractionHandler.MotionEventModel.Up
import com.android.systemui.util.mockito.any
import com.android.systemui.util.mockito.whenever
import com.google.common.truth.Truth.assertThat
@@ -40,13 +40,13 @@ import org.mockito.MockitoAnnotations

@SmallTest
@RunWith(AndroidJUnit4::class)
class LongPressHandlingViewInteractionHandlerTest : SysuiTestCase() {
class TouchHandlingViewInteractionHandlerTest : SysuiTestCase() {

    @Mock private lateinit var postDelayed: (Runnable, Long) -> DisposableHandle
    @Mock private lateinit var onLongPressDetected: (Int, Int) -> Unit
    @Mock private lateinit var onSingleTapDetected: (Int, Int) -> Unit

    private lateinit var underTest: LongPressHandlingViewInteractionHandler
    private lateinit var underTest: TouchHandlingViewInteractionHandler

    private var isAttachedToWindow: Boolean = true
    private var delayedRunnable: Runnable? = null
@@ -60,7 +60,7 @@ class LongPressHandlingViewInteractionHandlerTest : SysuiTestCase() {
        }

        underTest =
            LongPressHandlingViewInteractionHandler(
            TouchHandlingViewInteractionHandler(
                postDelayed = postDelayed,
                isAttachedToWindow = { isAttachedToWindow },
                onLongPressDetected = onLongPressDetected,
+4 −4
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ import com.android.systemui.SysuiTestCase;
import com.android.systemui.bouncer.domain.interactor.AlternateBouncerInteractor;
import com.android.systemui.classifier.FalsingCollectorFake;
import com.android.systemui.classifier.FalsingManagerFake;
import com.android.systemui.common.ui.view.LongPressHandlingView;
import com.android.systemui.common.ui.view.TouchHandlingView;
import com.android.systemui.deviceentry.domain.interactor.DeviceEntryFaceAuthInteractor;
import com.android.systemui.deviceentry.domain.interactor.DeviceEntryUdfpsInteractor;
import com.android.systemui.doze.DozeLog;
@@ -518,12 +518,12 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {

        mMainHandler = new Handler(Looper.getMainLooper());

        LongPressHandlingView longPressHandlingView = mock(LongPressHandlingView.class);
        TouchHandlingView touchHandlingView = mock(TouchHandlingView.class);
        when(mView.requireViewById(R.id.keyguard_long_press))
                .thenReturn(longPressHandlingView);
                .thenReturn(touchHandlingView);

        Resources longPressHandlingViewRes = mock(Resources.class);
        when(longPressHandlingView.getResources()).thenReturn(longPressHandlingViewRes);
        when(touchHandlingView.getResources()).thenReturn(longPressHandlingViewRes);
        when(longPressHandlingViewRes.getString(anyInt())).thenReturn("");

        mNotificationPanelViewController = new NotificationPanelViewController(
Loading