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

Commit 3cacf7e6 authored by Priyanka Advani's avatar Priyanka Advani Committed by Automerger Merge Worker
Browse files

Merge "Revert "Remove NativeInputManager::isPerDisplayTouchModeEnabled"" into...

Merge "Revert "Remove NativeInputManager::isPerDisplayTouchModeEnabled"" into udc-dev am: b3b6d239

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22341845



Change-Id: Iba9aa2a5257ce6a6cd8a73590c3b455218e9f984
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 94eb35aa b3b6d239
Loading
Loading
Loading
Loading
+17 −3
Original line number Original line Diff line number Diff line
@@ -136,7 +136,7 @@ static struct {
    jmethodID getContextForDisplay;
    jmethodID getContextForDisplay;
    jmethodID notifyDropWindow;
    jmethodID notifyDropWindow;
    jmethodID getParentSurfaceForPointers;
    jmethodID getParentSurfaceForPointers;
    jmethodID isStylusPointerIconEnabled;
    jmethodID isPerDisplayTouchModeEnabled;
} gServiceClassInfo;
} gServiceClassInfo;


static struct {
static struct {
@@ -369,6 +369,10 @@ public:
    virtual PointerIconStyle getCustomPointerIconId();
    virtual PointerIconStyle getCustomPointerIconId();
    virtual void onPointerDisplayIdChanged(int32_t displayId, const FloatPoint& position);
    virtual void onPointerDisplayIdChanged(int32_t displayId, const FloatPoint& position);


    /* --- If touch mode is enabled per display or global --- */

    virtual bool isPerDisplayTouchModeEnabled();

private:
private:
    sp<InputManagerInterface> mInputManager;
    sp<InputManagerInterface> mInputManager;


@@ -1641,6 +1645,16 @@ void NativeInputManager::setStylusButtonMotionEventsEnabled(bool enabled) {
            InputReaderConfiguration::CHANGE_STYLUS_BUTTON_REPORTING);
            InputReaderConfiguration::CHANGE_STYLUS_BUTTON_REPORTING);
}
}


bool NativeInputManager::isPerDisplayTouchModeEnabled() {
    JNIEnv* env = jniEnv();
    jboolean enabled =
            env->CallBooleanMethod(mServiceObj, gServiceClassInfo.isPerDisplayTouchModeEnabled);
    if (checkAndClearExceptionFromCallback(env, "isPerDisplayTouchModeEnabled")) {
        return false;
    }
    return static_cast<bool>(enabled);
}

FloatPoint NativeInputManager::getMouseCursorPosition() {
FloatPoint NativeInputManager::getMouseCursorPosition() {
    std::scoped_lock _l(mLock);
    std::scoped_lock _l(mLock);
    const auto pc = mLocked.pointerController.lock();
    const auto pc = mLocked.pointerController.lock();
@@ -2823,8 +2837,8 @@ int register_android_server_InputManager(JNIEnv* env) {
    GET_METHOD_ID(gServiceClassInfo.getParentSurfaceForPointers, clazz,
    GET_METHOD_ID(gServiceClassInfo.getParentSurfaceForPointers, clazz,
                  "getParentSurfaceForPointers", "(I)J");
                  "getParentSurfaceForPointers", "(I)J");


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


    // InputDevice
    // InputDevice