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

Commit 06db41a8 authored by Justin Weir's avatar Justin Weir
Browse files

Remove getShadeViewController calls

Bug: 288868098
Test: updated and ran affected test
Change-Id: I5b10c8f05749afea3a1ca0b43b3f6cefd0aa71e0
parent 1fb1192d
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -37,12 +37,15 @@ import javax.inject.Named;
 */
public class ShadeTouchHandler implements DreamTouchHandler {
    private final Optional<CentralSurfaces> mSurfaces;
    private final ShadeViewController mShadeViewController;
    private final int mInitiationHeight;

    @Inject
    ShadeTouchHandler(Optional<CentralSurfaces> centralSurfaces,
            ShadeViewController shadeViewController,
            @Named(NOTIFICATION_SHADE_GESTURE_INITIATION_HEIGHT) int initiationHeight) {
        mSurfaces = centralSurfaces;
        mShadeViewController = shadeViewController;
        mInitiationHeight = initiationHeight;
    }

@@ -54,12 +57,7 @@ public class ShadeTouchHandler implements DreamTouchHandler {
        }

        session.registerInputListener(ev -> {
            final ShadeViewController viewController =
                    mSurfaces.map(CentralSurfaces::getShadeViewController).orElse(null);

            if (viewController != null) {
                viewController.handleExternalTouch((MotionEvent) ev);
            }
            mShadeViewController.handleExternalTouch((MotionEvent) ev);

            if (ev instanceof MotionEvent) {
                if (((MotionEvent) ev).getAction() == MotionEvent.ACTION_UP) {
+1 −3
Original line number Diff line number Diff line
@@ -61,10 +61,8 @@ public class ShadeTouchHandlerTest extends SysuiTestCase {
    @Before
    public void setup() {
        MockitoAnnotations.initMocks(this);
        mTouchHandler = new ShadeTouchHandler(Optional.of(mCentralSurfaces),
        mTouchHandler = new ShadeTouchHandler(Optional.of(mCentralSurfaces), mShadeViewController,
                TOUCH_HEIGHT);
        when(mCentralSurfaces.getShadeViewController())
                .thenReturn(mShadeViewController);
    }

    /**