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

Commit e7583641 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add additional pointer state to input dumpsys"

parents 6381551e 1c1d459e
Loading
Loading
Loading
Loading
+43 −0
Original line number Diff line number Diff line
@@ -533,6 +533,13 @@ public final class PointerIcon implements Parcelable {
        mHotSpotY = hotSpotY;
    }

    @Override
    public String toString() {
        return "PointerIcon{type=" + typeToString(mType)
                + ", hotspotX=" + mHotSpotX + ", hotspotY=" + mHotSpotY
                + ", systemIconResourceId=" + mSystemIconResourceId + "}";
    }

    private static void validateHotSpot(Bitmap bitmap, float hotSpotX, float hotSpotY) {
        if (hotSpotX < 0 || hotSpotX >= bitmap.getWidth()) {
            throw new IllegalArgumentException("x hotspot lies outside of the bitmap area");
@@ -624,4 +631,40 @@ public final class PointerIcon implements Parcelable {
        displayManager.registerDisplayListener(sDisplayListener, null /* handler */);
    }

    /**
     * Convert type constant to string.
     * @hide
     */
    public static String typeToString(int type) {
        switch (type) {
            case TYPE_CUSTOM: return "CUSTOM";
            case TYPE_NULL: return "NULL";
            case TYPE_NOT_SPECIFIED: return "NOT_SPECIFIED";
            case TYPE_ARROW: return "ARROW";
            case TYPE_SPOT_HOVER: return "SPOT_HOVER";
            case TYPE_SPOT_TOUCH: return "SPOT_TOUCH";
            case TYPE_SPOT_ANCHOR: return "SPOT_ANCHOR";
            case TYPE_CONTEXT_MENU: return "CONTEXT_MENU";
            case TYPE_HAND: return "HAND";
            case TYPE_HELP: return "HELP";
            case TYPE_WAIT: return "WAIT";
            case TYPE_CELL: return "CELL";
            case TYPE_CROSSHAIR: return "CROSSHAIR";
            case TYPE_TEXT: return "TEXT";
            case TYPE_VERTICAL_TEXT: return "VERTICAL_TEXT";
            case TYPE_ALIAS: return "ALIAS";
            case TYPE_COPY: return "COPY";
            case TYPE_NO_DROP: return "NO_DROP";
            case TYPE_ALL_SCROLL: return "ALL_SCROLL";
            case TYPE_HORIZONTAL_DOUBLE_ARROW: return "HORIZONTAL_DOUBLE_ARROW";
            case TYPE_VERTICAL_DOUBLE_ARROW: return "VERTICAL_DOUBLE_ARROW";
            case TYPE_TOP_RIGHT_DIAGONAL_DOUBLE_ARROW: return "TOP_RIGHT_DIAGONAL_DOUBLE_ARROW";
            case TYPE_TOP_LEFT_DIAGONAL_DOUBLE_ARROW: return "TOP_LEFT_DIAGONAL_DOUBLE_ARROW";
            case TYPE_ZOOM_IN: return "ZOOM_IN";
            case TYPE_ZOOM_OUT: return "ZOOM_OUT";
            case TYPE_GRAB: return "GRAB";
            case TYPE_GRABBING: return "GRABBING";
            default: return Integer.toString(type);
        }
    }
}
+5 −0
Original line number Diff line number Diff line
@@ -2770,6 +2770,11 @@ public class InputManagerService extends IInputManager.Stub
            if (mOverriddenPointerDisplayId != Display.INVALID_DISPLAY) {
                pw.println("mOverriddenPointerDisplayId: " + mOverriddenPointerDisplayId);
            }

            pw.println("mAcknowledgedPointerDisplayId=" + mAcknowledgedPointerDisplayId);
            pw.println("mRequestedPointerDisplayId=" + mRequestedPointerDisplayId);
            pw.println("mPointerIconType=" + PointerIcon.typeToString(mPointerIconType));
            pw.println("mPointerIcon=" + mPointerIcon);
        }
    }
    private boolean checkCallingPermission(String permission, String func) {