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

Commit 32c79d02 authored by Prabir Pradhan's avatar Prabir Pradhan
Browse files

PointerIcon: Treat 0 as a valid type index for system icons

PointerIcon.TYPE_ALIAS maps to the style type index of 0, which we
incorrectly treat as "invalid" in the code. This means we can never load
the TYPE_ALIAS system icon correctly.

Fix this by using an index of -1 to represent an invalid index.

Fixes: 339233006
Test: presubmit
Change-Id: I28cb4ce53dafa9de88959ba425889fec42d1e722
parent 4058c394
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -234,7 +234,7 @@ public final class PointerIcon implements Parcelable {
        }

        int typeIndex = getSystemIconTypeIndex(type);
        if (typeIndex == 0) {
        if (typeIndex < 0) {
            typeIndex = getSystemIconTypeIndex(TYPE_DEFAULT);
        }

@@ -606,7 +606,7 @@ public final class PointerIcon implements Parcelable {
            case TYPE_HANDWRITING:
                return com.android.internal.R.styleable.Pointer_pointerIconHandwriting;
            default:
                return 0;
                return -1;
        }
    }