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

Commit 981e60ed authored by Svetoslav's avatar Svetoslav Committed by Android (Google) Code Review
Browse files

Merge "Refactoring of the Accessibility."

parents d21267a2 57bf8850
Loading
Loading
Loading
Loading
+34 −0
Original line number Diff line number Diff line
@@ -398,6 +398,13 @@ public class AccessibilityServiceInfo implements Parcelable {
        flags = other.flags;
    }

    /**
     * @hide
     */
    public void setComponentName(ComponentName component) {
        mId = component.flattenToShortString();
    }

    /**
     * The accessibility service id.
     * <p>
@@ -514,6 +521,33 @@ public class AccessibilityServiceInfo implements Parcelable {
        mNonLocalizedDescription = parcel.readString();
    }

    @Override
    public int hashCode() {
        return 31 * 1 + ((mId == null) ? 0 : mId.hashCode());
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        AccessibilityServiceInfo other = (AccessibilityServiceInfo) obj;
        if (mId == null) {
            if (other.mId != null) {
                return false;
            }
        } else if (!mId.equals(other.mId)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        StringBuilder stringBuilder = new StringBuilder();
+9 −5
Original line number Diff line number Diff line
@@ -234,11 +234,15 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo
        if (DEBUG) {
            Slog.i(TAG, "Handling batched event: " + event + ", policyFlags: " + policyFlags);
        }
        // Since we do batch processing it is possible that by the time the
        // next batch is processed the event handle had been set to null.
        if (mEventHandler != null) {
            mPm.userActivity(event.getEventTime(), false);
            MotionEvent transformedEvent = MotionEvent.obtain(event);
            mEventHandler.onMotionEvent(transformedEvent, event, policyFlags);
            transformedEvent.recycle();
        }
    }

    @Override
    public void onMotionEvent(MotionEvent transformedEvent, MotionEvent rawEvent,
+385 −434

File changed.

Preview size limit exceeded, changes collapsed.

+2 −1
Original line number Diff line number Diff line
@@ -86,8 +86,8 @@ final class DisplayMagnifier {
        mContext = windowManagerService.mContext;
        mWindowManagerService = windowManagerService;
        mCallbacks = callbacks;
        mMagnifedViewport = new MagnifiedViewport();
        mHandler = new MyHandler(mWindowManagerService.mH.getLooper());
        mMagnifedViewport = new MagnifiedViewport();
        mLongAnimationDuration = mContext.getResources().getInteger(
                com.android.internal.R.integer.config_longAnimTime);
    }
@@ -273,6 +273,7 @@ final class DisplayMagnifier {
                            mContext.getResources().getDisplayMetrics());
            mHalfBorderWidth = (int) (mBorderWidth + 0.5) / 2;
            mWindow = new ViewportWindow(mContext);
            recomputeBoundsLocked();
        }

        public void updateMagnificationSpecLocked(MagnificationSpec spec) {