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

Commit 61006ccf authored by Prabir Pradhan's avatar Prabir Pradhan
Browse files

InputManager: Cleanup after PointerChoreogpraher refactor

Bug: 311416205
Test: build, presubmit
Change-Id: I6b281cce79ef151ff8d5a3a355152d40049f5048
parent e9858f7d
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -148,8 +148,6 @@ interface IInputManager {

    IInputDeviceBatteryState getBatteryState(int deviceId);

    void setPointerIconType(int typeId);
    void setCustomPointerIcon(in PointerIcon icon);
    boolean setPointerIcon(in PointerIcon icon, int displayId, int deviceId, int pointerId,
            in IBinder inputToken);

+3 −10
Original line number Diff line number Diff line
@@ -992,21 +992,14 @@ public final class InputManager {
    }

    /**
     * Changes the mouse pointer's icon shape into the specified id.
     *
     * @param iconId The id of the pointer graphic, as a value between
     * {@link PointerIcon#TYPE_ARROW} and {@link PointerIcon#TYPE_HANDWRITING}.
     * This method exists for backwards-compatibility, and is a no-op.
     *
     * @deprecated
     * @hide
     */
    @UnsupportedAppUsage
    public void setPointerIconType(int iconId) {
        mGlobal.setPointerIconType(iconId);
    }

    /** @hide */
    public void setCustomPointerIcon(PointerIcon icon) {
        mGlobal.setCustomPointerIcon(icon);
        Log.e(TAG, "setPointerIcon: Unsupported app usage!");
    }

    /** @hide */
+0 −22
Original line number Diff line number Diff line
@@ -1410,28 +1410,6 @@ public final class InputManagerGlobal {
        return injectInputEvent(event, mode, Process.INVALID_UID);
    }

    /**
     * @see InputManager#setPointerIconType(int)
     */
    public void setPointerIconType(int iconId) {
        try {
            mIm.setPointerIconType(iconId);
        } catch (RemoteException ex) {
            throw ex.rethrowFromSystemServer();
        }
    }

    /**
     * @see InputManager#setCustomPointerIcon(PointerIcon)
     */
    public void setCustomPointerIcon(PointerIcon icon) {
        try {
            mIm.setCustomPointerIcon(icon);
        } catch (RemoteException ex) {
            throw ex.rethrowFromSystemServer();
        }
    }

    /**
     * @see InputManager#setPointerIcon(PointerIcon, int, int, int, IBinder)
     */
+4 −14
Original line number Diff line number Diff line
@@ -30695,21 +30695,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     */
    public void setPointerIcon(PointerIcon pointerIcon) {
        mMousePointerIcon = pointerIcon;
        if (com.android.input.flags.Flags.enablePointerChoreographer()) {
        final ViewRootImpl viewRootImpl = getViewRootImpl();
        if (viewRootImpl == null) {
            return;
        }
        viewRootImpl.refreshPointerIcon();
        } else {
            if (mAttachInfo == null || mAttachInfo.mHandlingPointerEvent) {
                return;
            }
            try {
                mAttachInfo.mSession.updatePointerIcon(mAttachInfo.mWindow);
            } catch (RemoteException e) {
            }
        }
    }
    /**
+9 −36
Original line number Diff line number Diff line
@@ -74,7 +74,6 @@ import static android.view.ViewRootImplProto.WIDTH;
import static android.view.ViewRootImplProto.WINDOW_ATTRIBUTES;
import static android.view.ViewRootImplProto.WIN_FRAME;
import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE;
import static android.view.WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS;
import static android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS;
import static android.view.WindowInsetsController.APPEARANCE_LOW_PROFILE_BARS;
@@ -96,6 +95,7 @@ import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_DECOR_V
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_INSET_PARENT_FRAME_BY_IME;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_LAYOUT_SIZE_EXTENDED_BY_CUTOUT;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_OPTIMIZE_MEASURE;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE;
import static android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE;
import static android.view.WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
@@ -122,7 +122,6 @@ import static android.view.flags.Flags.toolkitSetFrameRateReadOnly;
import static android.view.inputmethod.InputMethodEditorTraceProto.InputMethodClientsTraceProto.ClientSideProto.IME_FOCUS_CONTROLLER;
import static android.view.inputmethod.InputMethodEditorTraceProto.InputMethodClientsTraceProto.ClientSideProto.INSETS_CONTROLLER;
import static com.android.input.flags.Flags.enablePointerChoreographer;
import static com.android.internal.annotations.VisibleForTesting.Visibility.PACKAGE;
import static com.android.window.flags.Flags.activityWindowInfoFlag;
import static com.android.window.flags.Flags.enableBufferTransformHintFromDisplay;
@@ -7928,12 +7927,9 @@ public final class ViewRootImpl implements ViewParent,
        if (event.isStylusPointer() && mIsStylusPointerIconEnabled) {
            pointerIcon = mHandwritingInitiator.onResolvePointerIcon(mContext, event);
        }
        if (pointerIcon == null) {
            pointerIcon = mView.onResolvePointerIcon(event, pointerIndex);
        }
        if (enablePointerChoreographer()) {
        if (pointerIcon == null) {
            pointerIcon = PointerIcon.getSystemIcon(mContext, PointerIcon.TYPE_NOT_SPECIFIED);
        }
@@ -7948,29 +7944,6 @@ public final class ViewRootImpl implements ViewParent,
        return true;
    }
        final int pointerType = (pointerIcon != null) ?
                pointerIcon.getType() : PointerIcon.TYPE_NOT_SPECIFIED;
        if (mPointerIconType == null || mPointerIconType != pointerType) {
            mPointerIconType = pointerType;
            mCustomPointerIcon = null;
            if (mPointerIconType != PointerIcon.TYPE_CUSTOM) {
                InputManagerGlobal
                        .getInstance()
                        .setPointerIconType(pointerType);
                return true;
            }
        }
        if (mPointerIconType == PointerIcon.TYPE_CUSTOM &&
                !pointerIcon.equals(mCustomPointerIcon)) {
            mCustomPointerIcon = pointerIcon;
            InputManagerGlobal
                    .getInstance()
                    .setCustomPointerIcon(mCustomPointerIcon);
        }
        return true;
    }
    private void maybeUpdateTooltip(MotionEvent event) {
        if (event.getPointerCount() != 1) {
            return;
Loading