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

Commit d633c9c7 authored by vadimt's avatar vadimt
Browse files

Verifying events from TouchInteractionService

There is a guaranteed order in which TIS events will be registered
relative to other TIS events. However, relative to the touch events
arriving to the activity, TIS events can come in any order.

Now the event checker verifies 2 independent ordered event sequences:
from TIS, and “the rest” (Main).

Change-Id: I5872e0e3b0b498050a91c67105fbe4a29411375a
parent 70607cfe
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -145,7 +145,7 @@ public class TouchInteractionService extends Service implements PluginListener<O
        @BinderThread
        @Override
        public void onOverviewToggle() {
            TestLogging.recordEvent("onOverviewToggle");
            TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "onOverviewToggle");
            mOverviewCommandHelper.onOverviewToggle();
        }

@@ -428,13 +428,17 @@ public class TouchInteractionService extends Service implements PluginListener<O
            Log.e(TAG, "Unknown event " + ev);
            return;
        }
        MotionEvent event = (MotionEvent) ev;

        TestLogging.recordMotionEvent(
                TestProtocol.SEQUENCE_TIS, "TouchInteractionService.onInputEvent", event);

        if (!mDeviceState.isUserUnlocked()) {
            return;
        }

        Object traceToken = TraceHelper.INSTANCE.beginFlagsOverride(
                TraceHelper.FLAG_ALLOW_BINDER_TRACKING);
        MotionEvent event = (MotionEvent) ev;
        if (event.getAction() == ACTION_DOWN) {
            GestureState newGestureState = new GestureState(mOverviewComponentObserver,
                    ActiveGestureLog.INSTANCE.generateAndSetLogId());
+2 −1
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ package com.android.quickstep.inputconsumers;
import android.view.MotionEvent;

import com.android.launcher3.testing.TestLogging;
import com.android.launcher3.testing.TestProtocol;
import com.android.quickstep.InputConsumer;
import com.android.systemui.shared.system.InputMonitorCompat;

@@ -35,7 +36,7 @@ public abstract class DelegateInputConsumer implements InputConsumer {

    protected void setActive(MotionEvent ev) {
        mState = STATE_ACTIVE;
        TestLogging.recordEvent("pilferPointers");
        TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "pilferPointers");
        mInputMonitor.pilferPointers();

        // Send cancel event
+2 −1
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import android.view.ViewConfiguration;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.testing.TestLogging;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.util.DefaultDisplay;
import com.android.quickstep.GestureState;
import com.android.quickstep.InputConsumer;
@@ -203,7 +204,7 @@ public class DeviceLockedInputConsumer implements InputConsumer,

    private void startRecentsTransition() {
        mThresholdCrossed = true;
        TestLogging.recordEvent("pilferPointers");
        TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "pilferPointers");
        mInputMonitorCompat.pilferPointers();

        Intent intent = new Intent(Intent.ACTION_MAIN)
+2 −1
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ import androidx.annotation.UiThread;

import com.android.launcher3.R;
import com.android.launcher3.testing.TestLogging;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.util.Preconditions;
import com.android.launcher3.util.TraceHelper;
import com.android.quickstep.BaseActivityInterface;
@@ -303,7 +304,7 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
        if (mInteractionHandler == null) {
            return;
        }
        TestLogging.recordEvent("pilferPointers");
        TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "pilferPointers");
        mInputMonitorCompat.pilferPointers();

        mActivityInterface.closeOverlay();
+2 −1
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import androidx.annotation.Nullable;
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.Utilities;
import com.android.launcher3.testing.TestLogging;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.views.BaseDragLayer;
import com.android.quickstep.BaseActivityInterface;
import com.android.quickstep.GestureState;
@@ -107,7 +108,7 @@ public class OverviewInputConsumer<T extends BaseDraggingActivity>
                ActiveGestureLog.INSTANCE.addLog("startQuickstep");
            }
            if (mInputMonitor != null) {
                TestLogging.recordEvent("pilferPointers");
                TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "pilferPointers");
                mInputMonitor.pilferPointers();
            }
        }
Loading