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

Commit 1f3dbffa authored by Jun Mukai's avatar Jun Mukai
Browse files

Reset gSystemIcons when accessibility large icon settings has changed.

Otherwise the previous icons are simply reused, so the new setting
has no effects.

Bug: 25778857
Change-Id: I2cec4982747f8f36feabeef4ba6689bd8f0b2c15
parent 47a9fb3b
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -139,9 +139,7 @@ public final class PointerIcon implements Parcelable {

    private static final PointerIcon gNullIcon = new PointerIcon(STYLE_NULL);
    private static final SparseArray<PointerIcon> gSystemIcons = new SparseArray<PointerIcon>();

    /** @hide */
    public static boolean sUseLargeIcons = false;
    private static boolean sUseLargeIcons = false;

    private final int mStyle;
    private int mSystemIconResourceId;
@@ -234,6 +232,15 @@ public final class PointerIcon implements Parcelable {
        return icon;
    }

    /**
     * Updates wheter accessibility large icons are used or not.
     * @hide
     */
    public static void setUseLargeIcons(boolean use) {
        sUseLargeIcons = use;
        gSystemIcons.clear();
    }

    /**
     * Creates a custom pointer from the given bitmap and hotspot information.
     *
+1 −1
Original line number Diff line number Diff line
@@ -1371,7 +1371,7 @@ public class InputManagerService extends IInputManager.Stub
        final int accessibilityConfig = Settings.Secure.getIntForUser(
                mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_LARGE_POINTER_ICON,
                0, UserHandle.USER_CURRENT);
        PointerIcon.sUseLargeIcons = (accessibilityConfig == 1);
        PointerIcon.setUseLargeIcons(accessibilityConfig == 1);
        nativeReloadPointerIcons(mPtr);
    }