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

Commit dbc75830 authored by vadimt's avatar vadimt
Browse files

Remove unnecessary PilferPointer events and enable testPressHomeOnAllAppsContextMenu

Change-Id: I04199f46024b05f05d04ba2be7a797842bb48527
parent d71c3b18
Loading
Loading
Loading
Loading
+17 −13
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ import android.graphics.Rect;
import android.graphics.RectF;
import android.os.Build;
import android.util.AttributeSet;
import android.util.Log;
import android.util.Property;
import android.view.MotionEvent;
import android.view.View;
@@ -41,8 +40,8 @@ import android.widget.FrameLayout;

import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.InsettableFrameLayout;
import com.android.launcher3.Launcher;
import com.android.launcher3.Utilities;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.util.MultiValueAlpha;
import com.android.launcher3.util.MultiValueAlpha.AlphaProperty;
import com.android.launcher3.util.TouchController;
@@ -150,11 +149,21 @@ public abstract class BaseDragLayer<T extends Context & ActivityContext>
        return findActiveController(ev);
    }

    private boolean isEventInLauncher(MotionEvent ev) {
        final float x = ev.getX();
        final float y = ev.getY();

        return x >= mSystemGestureRegion.left && x < getWidth() - mSystemGestureRegion.right
                && y >= mSystemGestureRegion.top && y < getHeight() - mSystemGestureRegion.bottom;
    }

    private TouchController findControllerToHandleTouch(MotionEvent ev) {
        if (isEventInLauncher(ev)) {
            AbstractFloatingView topView = AbstractFloatingView.getTopOpenView(mActivity);
            if (topView != null && topView.onControllerInterceptTouchEvent(ev)) {
                return topView;
            }
        }

        for (TouchController controller : mControllers) {
            if (controller.onControllerInterceptTouchEvent(ev)) {
@@ -245,17 +254,12 @@ public abstract class BaseDragLayer<T extends Context & ActivityContext>
    public boolean dispatchTouchEvent(MotionEvent ev) {
        switch (ev.getAction()) {
            case ACTION_DOWN: {
                float x = ev.getX();
                float y = ev.getY();
                mTouchDispatchState |= TOUCH_DISPATCHING_VIEW;

                if ((y < mSystemGestureRegion.top
                        || x < mSystemGestureRegion.left
                        || x > (getWidth() - mSystemGestureRegion.right)
                        || y > (getHeight() - mSystemGestureRegion.bottom))) {
                    mTouchDispatchState |= TOUCH_DISPATCHING_GESTURE;
                } else {
                if (isEventInLauncher(ev)) {
                    mTouchDispatchState &= ~TOUCH_DISPATCHING_GESTURE;
                } else {
                    mTouchDispatchState |= TOUCH_DISPATCHING_GESTURE;
                }
                break;
            }
+0 −2
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ import com.android.launcher3.widget.WidgetsFullSheet;
import com.android.launcher3.widget.WidgetsRecyclerView;

import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

@@ -110,7 +109,6 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
    }

    @Test
    @Ignore
    public void testPressHomeOnAllAppsContextMenu() throws Exception {
        final AllApps allApps = mLauncher.getWorkspace().switchToAllApps();
        allApps.freeze();
+0 −8
Original line number Diff line number Diff line
@@ -649,14 +649,6 @@ public final class LauncherInstrumentation {
                try (LauncherInstrumentation.Closable c = addContextLayer(action)) {
                    mDevice.waitForIdle();

                    if (getNavigationModel() == NavigationModel.TWO_BUTTON) {
                        if (hasLauncherObject(CONTEXT_MENU_RES_ID) ||
                                hasLauncherObject(WIDGETS_RES_ID)
                                        && !mDevice.isNaturalOrientation()) {
                            expectEvent(TestProtocol.SEQUENCE_MAIN, EVENT_PILFER_POINTERS);
                        }
                    }

                    if (getNavigationModel() == NavigationModel.TWO_BUTTON) {
                        expectEvent(TestProtocol.SEQUENCE_TIS, EVENT_TOUCH_DOWN_TIS);
                        expectEvent(TestProtocol.SEQUENCE_TIS, EVENT_TOUCH_UP_TIS);