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

Commit 7b1e0c70 authored by Svetoslav Ganov's avatar Svetoslav Ganov
Browse files

Removing default accessibility gesture handling.

1. The initial design was to have some accessibility gestures
   being handled by the system if the gesture handling access
   service does not consume the gesture. However, we are not
   sure what a good default is and once we add a default handler
   we cannot remove it since people may rely on it. Thus, we
   take the simples approach and let the accessibility service
   handle the gestures. If no gestures are handled the system
   will work in explore by touch as before.

bug:5932640

Change-Id: I865a83549fa03b0141d27ce9713e9b7bb45a57b4
parent 8d8176d4
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -61,7 +61,6 @@ LOCAL_SRC_FILES := $(filter-out \
LOCAL_SRC_FILES += \
	core/java/android/accessibilityservice/IAccessibilityServiceConnection.aidl \
	core/java/android/accessibilityservice/IAccessibilityServiceClient.aidl \
	core/java/android/accessibilityservice/IAccessibilityServiceClientCallback.aidl \
	core/java/android/accounts/IAccountManager.aidl \
	core/java/android/accounts/IAccountManagerResponse.aidl \
	core/java/android/accounts/IAccountAuthenticator.aidl \
+3 −0
Original line number Diff line number Diff line
@@ -129,6 +129,9 @@ $(call add-clean-step, rm -rf $(OUT_DIR)/host/$(HOST_PREBUILT_TAG)/obj/STATIC_LI
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/core/java/android/accessibilityservice/IEventListener.java)
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/core/java/android/accessibilityservice/IEventListener.P)
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/core/java/android/view/accessibility/IAccessibilityManager.P)
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/core/java/android/accessibilityservice/IAccessibilityServiceClientCallback.java)
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/core/java/android/accessibilityservice/IAccessibilityServiceClientCallback.P)
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/core/java/android/accessibilityservice/IAccessibilityServiceClient.P)
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************
+4 −14
Original line number Diff line number Diff line
@@ -371,7 +371,7 @@ public abstract class AccessibilityService extends Service {
     *
     * <strong>Note:</strong> To receive gestures an accessibility service must
     * request that the device is in touch exploration mode by setting the
     * {@link android.accessibilityservice.AccessibilityServiceInfo#FLAG_INCLUDE_NOT_IMPORTANT_VIEWS}
     * {@link android.accessibilityservice.AccessibilityServiceInfo#FLAG_REQUEST_TOUCH_EXPLORATION_MODE}
     * flag.
     *
     * @param gestureId The unique id of the performed gesture.
@@ -565,10 +565,8 @@ public abstract class AccessibilityService extends Service {
            mCaller.sendMessage(message);
        }

        public void onGesture(int gestureId, IAccessibilityServiceClientCallback callback,
                int interactionId) {
            Message message = mCaller.obtainMessageIIO(DO_ON_GESTURE, gestureId, interactionId,
                    callback);
        public void onGesture(int gestureId) {
            Message message = mCaller.obtainMessageI(DO_ON_GESTURE, gestureId);
            mCaller.sendMessage(message);
        }

@@ -601,15 +599,7 @@ public abstract class AccessibilityService extends Service {
                    return;
                case DO_ON_GESTURE :
                    final int gestureId = message.arg1;
                    final int interactionId = message.arg2;
                    IAccessibilityServiceClientCallback callback =
                        (IAccessibilityServiceClientCallback) message.obj;
                    final boolean handled = mCallback.onGesture(gestureId);
                    try {
                        callback.setGestureResult(gestureId, handled, interactionId);
                    } catch (RemoteException re) {
                        Log.e(LOG_TAG, "Error calling back with the gesture resut.", re);
                    }
                    mCallback.onGesture(gestureId);
                    return;
                default :
                    Log.w(LOG_TAG, "Unknown message type " + message.what);
+1 −2
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package android.accessibilityservice;

import android.accessibilityservice.IAccessibilityServiceClientCallback;
import android.accessibilityservice.IAccessibilityServiceConnection;
import android.view.accessibility.AccessibilityEvent;

@@ -33,5 +32,5 @@ import android.view.accessibility.AccessibilityEvent;

    void onInterrupt();

    void onGesture(int gesture, in IAccessibilityServiceClientCallback callback, int interactionId);
    void onGesture(int gesture);
}
+0 −30
Original line number Diff line number Diff line
/*
** Copyright 2012, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/

package android.accessibilityservice;

import android.accessibilityservice.IAccessibilityServiceConnection;
import android.view.accessibility.AccessibilityEvent;

/**
 * Callback for IAccessibilityServiceClient.
 *
 * @hide
 */
 oneway interface IAccessibilityServiceClientCallback {

    void setGestureResult(int gestureId, boolean handled, int interactionId);
}
Loading