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

Commit 1a1571d9 authored by Byoungho Jung's avatar Byoungho Jung Committed by Prabir Pradhan
Browse files

Add setPointerIcon for PointerChoreographer (base)

To set pointer icon for mouse or stylus, we are going to use
setPointerIcon with more parameters which will be useful for
multi-device experience and security.

Test: Manual
Bug: 293587049
Change-Id: I17bb047b0bfbff6cf3a129e4fa742ec489420faf
parent c1ac283d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -169,6 +169,8 @@ interface IInputManager {

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

    oneway void requestPointerCapture(IBinder inputChannelToken, boolean enabled);

+6 −0
Original line number Diff line number Diff line
@@ -1057,6 +1057,12 @@ public final class InputManager {
        mGlobal.setCustomPointerIcon(icon);
    }

    /** @hide */
    public boolean setPointerIcon(PointerIcon icon, int displayId, int deviceId, int pointerId,
            IBinder inputToken) {
        return mGlobal.setPointerIcon(icon, displayId, deviceId, pointerId, inputToken);
    }

    /**
     * Check if showing a {@link android.view.PointerIcon} for styluses is enabled.
     *
+12 −0
Original line number Diff line number Diff line
@@ -1285,6 +1285,18 @@ public final class InputManagerGlobal {
        }
    }

    /**
     * @see InputManager#setPointerIcon(PointerIcon, int, int, int, IBinder)
     */
    public boolean setPointerIcon(PointerIcon icon, int displayId, int deviceId, int pointerId,
            IBinder inputToken) {
        try {
            return mIm.setPointerIcon(icon, displayId, deviceId, pointerId, inputToken);
        } catch (RemoteException ex) {
            throw ex.rethrowFromSystemServer();
        }
    }

    /**
     * @see InputManager#requestPointerCapture(IBinder, boolean)
     */
+0 −18
Original line number Diff line number Diff line
@@ -1307,24 +1307,6 @@ public final class InputDevice implements Parcelable {
        return mHasSensor;
    }

    /**
     * Sets the current pointer type.
     * @param pointerType the type of the pointer icon.
     * @hide
     */
    public void setPointerType(int pointerType) {
        InputManagerGlobal.getInstance().setPointerIconType(pointerType);
    }

    /**
     * Specifies the current custom pointer.
     * @param icon the icon data.
     * @hide
     */
    public void setCustomPointerIcon(PointerIcon icon) {
        InputManagerGlobal.getInstance().setCustomPointerIcon(icon);
    }

    /**
     * Reports whether the device has a battery.
     * @return true if the device has a battery, false otherwise.
+3 −0
Original line number Diff line number Diff line
@@ -223,6 +223,9 @@ public final class PointerIcon implements Parcelable {
     * @throws IllegalArgumentException if context is null.
     */
    public static @NonNull PointerIcon getSystemIcon(@NonNull Context context, int type) {
        // TODO(b/293587049): Pointer Icon Refactor: There is no need to load the system
        // icon resource into memory outside of system server. Remove the need to load
        // resources when getting a system icon.
        if (context == null) {
            throw new IllegalArgumentException("context must not be null");
        }
Loading