Loading core/java/android/accessibilityservice/AccessibilityService.java +5 −0 Original line number Diff line number Diff line Loading @@ -600,11 +600,16 @@ public abstract class AccessibilityService extends Service { * Dispatch a gesture to the touch screen. Any gestures currently in progress, whether from * the user, this service, or another service, will be cancelled. * <p> * The gesture will be dispatched as if it were performed directly on the screen by a user, so * the events may be affected by features such as magnification and explore by touch. * </p> * <p> * <strong>Note:</strong> In order to dispatch gestures, your service * must declare the capability by setting the * {@link android.R.styleable#AccessibilityService_canPerformGestures} * property in its meta-data. For more information, see * {@link #SERVICE_META_DATA}. * </p> * * @param gesture The gesture to dispatch * @param callback The object to call back when the status of the gesture is known. If Loading services/accessibility/java/com/android/server/accessibility/AccessibilityInputFilter.java +6 −6 Original line number Diff line number Diff line Loading @@ -363,12 +363,6 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo private void enableFeatures() { resetStreamState(); if ((mEnabledFeatures & FLAG_FEATURE_INJECT_MOTION_EVENTS) != 0) { mMotionEventInjector = new MotionEventInjector(mContext.getMainLooper()); addFirstEventHandler(mMotionEventInjector); mAms.setMotionEventInjector(mMotionEventInjector); } if ((mEnabledFeatures & FLAG_FEATURE_AUTOCLICK) != 0) { mAutoclickController = new AutoclickController(mContext, mUserId); addFirstEventHandler(mAutoclickController); Loading @@ -384,6 +378,12 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo addFirstEventHandler(mMagnificationGestureHandler); } if ((mEnabledFeatures & FLAG_FEATURE_INJECT_MOTION_EVENTS) != 0) { mMotionEventInjector = new MotionEventInjector(mContext.getMainLooper()); addFirstEventHandler(mMotionEventInjector); mAms.setMotionEventInjector(mMotionEventInjector); } if ((mEnabledFeatures & FLAG_FEATURE_FILTER_KEY_EVENTS) != 0) { mKeyboardInterceptor = new KeyboardInterceptor(mAms); addFirstEventHandler(mKeyboardInterceptor); Loading services/accessibility/java/com/android/server/accessibility/MagnificationController.java +6 −6 Original line number Diff line number Diff line Loading @@ -156,10 +156,10 @@ class MagnificationController { final float offsetY = sentSpec.offsetY; // Compute the new center and update spec as needed. final float centerX = (mMagnifiedBounds.width() / 2.0f + mMagnifiedBounds.left - offsetX) / scale; final float centerY = (mMagnifiedBounds.height() / 2.0f + mMagnifiedBounds.top - offsetY) / scale; final float centerX = (mMagnifiedBounds.width() / 2.0f - offsetX) / scale + mMagnifiedBounds.left; final float centerY = (mMagnifiedBounds.height() / 2.0f - offsetY) / scale + mMagnifiedBounds.top; if (updateSpec) { setScaleAndCenter(scale, centerX, centerY, false); } else { Loading Loading @@ -256,7 +256,7 @@ class MagnificationController { public float getCenterX() { synchronized (mLock) { return (mMagnifiedBounds.width() / 2.0f + mMagnifiedBounds.left - getOffsetX()) / getScale(); - getOffsetX()) / getScale() + mMagnifiedBounds.left; } } Loading @@ -279,7 +279,7 @@ class MagnificationController { public float getCenterY() { synchronized (mLock) { return (mMagnifiedBounds.height() / 2.0f + mMagnifiedBounds.top - getOffsetY()) / getScale(); - getOffsetY()) / getScale() + mMagnifiedBounds.top; } } Loading Loading
core/java/android/accessibilityservice/AccessibilityService.java +5 −0 Original line number Diff line number Diff line Loading @@ -600,11 +600,16 @@ public abstract class AccessibilityService extends Service { * Dispatch a gesture to the touch screen. Any gestures currently in progress, whether from * the user, this service, or another service, will be cancelled. * <p> * The gesture will be dispatched as if it were performed directly on the screen by a user, so * the events may be affected by features such as magnification and explore by touch. * </p> * <p> * <strong>Note:</strong> In order to dispatch gestures, your service * must declare the capability by setting the * {@link android.R.styleable#AccessibilityService_canPerformGestures} * property in its meta-data. For more information, see * {@link #SERVICE_META_DATA}. * </p> * * @param gesture The gesture to dispatch * @param callback The object to call back when the status of the gesture is known. If Loading
services/accessibility/java/com/android/server/accessibility/AccessibilityInputFilter.java +6 −6 Original line number Diff line number Diff line Loading @@ -363,12 +363,6 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo private void enableFeatures() { resetStreamState(); if ((mEnabledFeatures & FLAG_FEATURE_INJECT_MOTION_EVENTS) != 0) { mMotionEventInjector = new MotionEventInjector(mContext.getMainLooper()); addFirstEventHandler(mMotionEventInjector); mAms.setMotionEventInjector(mMotionEventInjector); } if ((mEnabledFeatures & FLAG_FEATURE_AUTOCLICK) != 0) { mAutoclickController = new AutoclickController(mContext, mUserId); addFirstEventHandler(mAutoclickController); Loading @@ -384,6 +378,12 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo addFirstEventHandler(mMagnificationGestureHandler); } if ((mEnabledFeatures & FLAG_FEATURE_INJECT_MOTION_EVENTS) != 0) { mMotionEventInjector = new MotionEventInjector(mContext.getMainLooper()); addFirstEventHandler(mMotionEventInjector); mAms.setMotionEventInjector(mMotionEventInjector); } if ((mEnabledFeatures & FLAG_FEATURE_FILTER_KEY_EVENTS) != 0) { mKeyboardInterceptor = new KeyboardInterceptor(mAms); addFirstEventHandler(mKeyboardInterceptor); Loading
services/accessibility/java/com/android/server/accessibility/MagnificationController.java +6 −6 Original line number Diff line number Diff line Loading @@ -156,10 +156,10 @@ class MagnificationController { final float offsetY = sentSpec.offsetY; // Compute the new center and update spec as needed. final float centerX = (mMagnifiedBounds.width() / 2.0f + mMagnifiedBounds.left - offsetX) / scale; final float centerY = (mMagnifiedBounds.height() / 2.0f + mMagnifiedBounds.top - offsetY) / scale; final float centerX = (mMagnifiedBounds.width() / 2.0f - offsetX) / scale + mMagnifiedBounds.left; final float centerY = (mMagnifiedBounds.height() / 2.0f - offsetY) / scale + mMagnifiedBounds.top; if (updateSpec) { setScaleAndCenter(scale, centerX, centerY, false); } else { Loading Loading @@ -256,7 +256,7 @@ class MagnificationController { public float getCenterX() { synchronized (mLock) { return (mMagnifiedBounds.width() / 2.0f + mMagnifiedBounds.left - getOffsetX()) / getScale(); - getOffsetX()) / getScale() + mMagnifiedBounds.left; } } Loading @@ -279,7 +279,7 @@ class MagnificationController { public float getCenterY() { synchronized (mLock) { return (mMagnifiedBounds.height() / 2.0f + mMagnifiedBounds.top - getOffsetY()) / getScale(); - getOffsetY()) / getScale() + mMagnifiedBounds.top; } } Loading