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

Commit 19a56019 authored by Jun Mukai's avatar Jun Mukai
Browse files

Introduce accessibility large pointer icons.

This patch does the following things:
- add new graphic assets of large icons for accessibility needs
  (imported from ChromeOS data)
- add the logic to choose the set of normal icons or accessibility icons
- make InputManagerService to observe the settings change, so that
  it can reload the new resources

This patch misses non-1x graphic though, because ChromeOS doesn't
have such data.

Bug: 25778857
Change-Id: Ia5f95d47f50b3f6eea555c3af8069bc6bae0b400
parent 28860b75
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -4919,6 +4919,15 @@ public final class Settings {
        public static final String ACCESSIBILITY_AUTOCLICK_DELAY =
                "accessibility_autoclick_delay";

        /**
         * Whether or not larger size icons are used for the pointer of mouse/trackpad for
         * accessibility.
         * (0 = false, 1 = true)
         * @hide
         */
        public static final String ACCESSIBILITY_LARGE_POINTER_ICON =
                "accessibility_large_pointer_icon";

        /**
         * The timeout for considering a press to be a long press in milliseconds.
         * @hide
+8 −1
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package android.view;

import android.os.UserHandle;
import android.provider.Settings;
import com.android.internal.util.XmlUtils;

import android.annotation.XmlRes;
@@ -199,9 +201,14 @@ public final class PointerIcon implements Parcelable {
            styleIndex = getSystemIconStyleIndex(STYLE_DEFAULT);
        }

        int accessibilityConfig = Settings.Secure.getIntForUser(
                    context.getContentResolver(), Settings.Secure.ACCESSIBILITY_LARGE_POINTER_ICON,
                    0, UserHandle.USER_CURRENT);
        int defStyle = (accessibilityConfig == 1) ?
                com.android.internal.R.style.LargePointer : com.android.internal.R.style.Pointer;
        TypedArray a = context.obtainStyledAttributes(null,
                com.android.internal.R.styleable.Pointer,
                com.android.internal.R.attr.pointerStyle, 0);
                0, defStyle);
        int resourceId = a.getResourceId(styleIndex, -1);
        a.recycle();

+2.3 KiB
Loading image diff...
+1.14 KiB
Loading image diff...
+1.06 KiB
Loading image diff...
Loading