Android AccessibilityService onGesture() is disabling Touch

Viewed 212

Im trying to make my AccessibilityService listen to one specific gesture, which is working. However now with any other gesture nothing happens. I can't even click anywhere. This is what the onGesture function currently looks like:

    @Override
    protected boolean onGesture(int gestureId) {
        switch (gestureId) {
            case GESTURE_SWIPE_DOWN_AND_UP:
                if(isPanelOut){
                    parentPanel.pushIn();
                }
                else {
                    parentPanel.pullOut();
                }
                isPanelOut = !isPanelOut;
                break;
        }
        return super.onGesture(gestureId);
    }

So basically the Phone is only listening to the swipe-down-and-up gesture...

1 Answers

Please, take a look at the OnGesture documentation. You should return false in order to not to handle the touch.

@Override
protected boolean onGesture(int gestureId) {
    switch (gestureId) {
        case GESTURE_SWIPE_DOWN_AND_UP:
            if(isPanelOut){
                parentPanel.pushIn();
            }
            else {
                parentPanel.pullOut();
            }
            isPanelOut = !isPanelOut;
            break;
    }
    return false;
}
Related