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

Commit 492922a6 authored by Seunghwan Choi's avatar Seunghwan Choi Committed by Prabir Pradhan
Browse files

check config for showing a stylus pointer (frameworks/base part)

On InputReader, get the configuration from config.xml
to decide whether to show a stylus pointer.

Test: Manual Test(hover pointer on handwriting area)
Bug: b/215436642
Change-Id: Ia08052f97e027c48d3bbc76ad03988722a7d9e2f
parent 670b33dd
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2974,6 +2974,13 @@ public class InputManagerService extends IInputManager.Stub
        return null;
    }

    // Native callback.
    @SuppressWarnings("unused")
    private boolean isStylusPointerIconEnabled() {
        return Objects.requireNonNull(mContext.getSystemService(InputManager.class))
                .isStylusPointerIconEnabled();
    }

    private static class PointerDisplayIdChangedArgs {
        final int mPointerDisplayId;
        final float mXPosition;
+10 −0
Original line number Diff line number Diff line
@@ -137,6 +137,7 @@ static struct {
    jmethodID notifyDropWindow;
    jmethodID getParentSurfaceForPointers;
    jmethodID isPerDisplayTouchModeEnabled;
    jmethodID isStylusPointerIconEnabled;
} gServiceClassInfo;

static struct {
@@ -660,6 +661,12 @@ void NativeInputManager::getReaderConfiguration(InputReaderConfiguration* outCon
        outConfig->pointerGestureTapSlop = hoverTapSlop;
    }

    jboolean stylusPointerIconEnabled =
            env->CallBooleanMethod(mServiceObj, gServiceClassInfo.isStylusPointerIconEnabled);
    if (!checkAndClearExceptionFromCallback(env, "isStylusPointerIconEnabled")) {
        outConfig->stylusPointerIconEnabled = stylusPointerIconEnabled;
    }

    { // acquire lock
        AutoMutex _l(mLock);

@@ -2793,6 +2800,9 @@ int register_android_server_InputManager(JNIEnv* env) {
    GET_METHOD_ID(gServiceClassInfo.isPerDisplayTouchModeEnabled, clazz,
                  "isPerDisplayTouchModeEnabled", "()Z");

    GET_METHOD_ID(gServiceClassInfo.isStylusPointerIconEnabled, clazz, "isStylusPointerIconEnabled",
                  "()Z");

    // InputDevice

    FIND_CLASS(gInputDeviceClassInfo.clazz, "android/view/InputDevice");