Loading include/input/InputVerifier.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -46,7 +46,7 @@ class InputVerifier { public: public: InputVerifier(const std::string& name); InputVerifier(const std::string& name); android::base::Result<void> processMovement(int32_t deviceId, int32_t action, android::base::Result<void> processMovement(int32_t deviceId, int32_t source, int32_t action, uint32_t pointerCount, uint32_t pointerCount, const PointerProperties* pointerProperties, const PointerProperties* pointerProperties, const PointerCoords* pointerCoords, int32_t flags); const PointerCoords* pointerCoords, int32_t flags); Loading libs/graphicsenv/GraphicsEnv.cpp +1 −2 Original line number Original line Diff line number Diff line Loading @@ -63,8 +63,7 @@ typedef bool (*fpANGLEFreeSystemInfoHandle)(void* handle); namespace { namespace { static bool isVndkEnabled() { static bool isVndkEnabled() { #ifdef __BIONIC__ #ifdef __BIONIC__ // TODO(b/290159430) Use ro.vndk.version to check if VNDK is enabled instead static bool isVndkEnabled = android::base::GetProperty("ro.vndk.version", "") != ""; static bool isVndkEnabled = !android::base::GetBoolProperty("ro.vndk.deprecate", false); return isVndkEnabled; return isVndkEnabled; #endif #endif return false; return false; Loading libs/gui/Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -200,6 +200,7 @@ aconfig_declarations { cc_aconfig_library { cc_aconfig_library { name: "libguiflags", name: "libguiflags", host_supported: true, vendor_available: true, vendor_available: true, aconfig_declarations: "libgui_flags", aconfig_declarations: "libgui_flags", } } Loading libs/input/Android.bp +22 −0 Original line number Original line Diff line number Diff line Loading @@ -90,6 +90,28 @@ rust_bindgen { "--allowlist-var=AMOTION_EVENT_ACTION_DOWN", "--allowlist-var=AMOTION_EVENT_ACTION_DOWN", "--allowlist-var=AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT", "--allowlist-var=AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT", "--allowlist-var=MAX_POINTER_ID", "--allowlist-var=MAX_POINTER_ID", "--allowlist-var=AINPUT_SOURCE_CLASS_NONE", "--allowlist-var=AINPUT_SOURCE_CLASS_BUTTON", "--allowlist-var=AINPUT_SOURCE_CLASS_POINTER", "--allowlist-var=AINPUT_SOURCE_CLASS_NAVIGATION", "--allowlist-var=AINPUT_SOURCE_CLASS_POSITION", "--allowlist-var=AINPUT_SOURCE_CLASS_JOYSTICK", "--allowlist-var=AINPUT_SOURCE_UNKNOWN", "--allowlist-var=AINPUT_SOURCE_KEYBOARD", "--allowlist-var=AINPUT_SOURCE_DPAD", "--allowlist-var=AINPUT_SOURCE_GAMEPAD", "--allowlist-var=AINPUT_SOURCE_TOUCHSCREEN", "--allowlist-var=AINPUT_SOURCE_MOUSE", "--allowlist-var=AINPUT_SOURCE_STYLUS", "--allowlist-var=AINPUT_SOURCE_BLUETOOTH_STYLUS", "--allowlist-var=AINPUT_SOURCE_TRACKBALL", "--allowlist-var=AINPUT_SOURCE_MOUSE_RELATIVE", "--allowlist-var=AINPUT_SOURCE_TOUCHPAD", "--allowlist-var=AINPUT_SOURCE_TOUCH_NAVIGATION", "--allowlist-var=AINPUT_SOURCE_JOYSTICK", "--allowlist-var=AINPUT_SOURCE_HDMI", "--allowlist-var=AINPUT_SOURCE_SENSOR", "--allowlist-var=AINPUT_SOURCE_ROTARY_ENCODER", ], ], static_libs: [ static_libs: [ Loading libs/input/InputTransport.cpp +3 −3 Original line number Original line Diff line number Diff line Loading @@ -632,8 +632,8 @@ status_t InputPublisher::publishMotionEvent( MotionEvent::actionToString(action).c_str())); MotionEvent::actionToString(action).c_str())); if (verifyEvents()) { if (verifyEvents()) { Result<void> result = Result<void> result = mInputVerifier.processMovement(deviceId, action, pointerCount, pointerProperties, mInputVerifier.processMovement(deviceId, source, action, pointerCount, pointerCoords, flags); pointerProperties, pointerCoords, flags); if (!result.ok()) { if (!result.ok()) { LOG(FATAL) << "Bad stream: " << result.error(); LOG(FATAL) << "Bad stream: " << result.error(); } } Loading Loading @@ -1276,13 +1276,13 @@ void InputConsumer::resampleTouchState(nsecs_t sampleTime, MotionEvent* event, PointerCoords& resampledCoords = touchState.lastResample.pointers[i]; PointerCoords& resampledCoords = touchState.lastResample.pointers[i]; const PointerCoords& currentCoords = current->getPointerById(id); const PointerCoords& currentCoords = current->getPointerById(id); resampledCoords = currentCoords; resampledCoords = currentCoords; resampledCoords.isResampled = true; if (other->idBits.hasBit(id) && shouldResampleTool(event->getToolType(i))) { if (other->idBits.hasBit(id) && shouldResampleTool(event->getToolType(i))) { const PointerCoords& otherCoords = other->getPointerById(id); const PointerCoords& otherCoords = other->getPointerById(id); resampledCoords.setAxisValue(AMOTION_EVENT_AXIS_X, resampledCoords.setAxisValue(AMOTION_EVENT_AXIS_X, lerp(currentCoords.getX(), otherCoords.getX(), alpha)); lerp(currentCoords.getX(), otherCoords.getX(), alpha)); resampledCoords.setAxisValue(AMOTION_EVENT_AXIS_Y, resampledCoords.setAxisValue(AMOTION_EVENT_AXIS_Y, lerp(currentCoords.getY(), otherCoords.getY(), alpha)); lerp(currentCoords.getY(), otherCoords.getY(), alpha)); resampledCoords.isResampled = true; ALOGD_IF(debugResampling(), ALOGD_IF(debugResampling(), "[%d] - out (%0.3f, %0.3f), cur (%0.3f, %0.3f), " "[%d] - out (%0.3f, %0.3f), cur (%0.3f, %0.3f), " "other (%0.3f, %0.3f), alpha %0.3f", "other (%0.3f, %0.3f), alpha %0.3f", Loading Loading
include/input/InputVerifier.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -46,7 +46,7 @@ class InputVerifier { public: public: InputVerifier(const std::string& name); InputVerifier(const std::string& name); android::base::Result<void> processMovement(int32_t deviceId, int32_t action, android::base::Result<void> processMovement(int32_t deviceId, int32_t source, int32_t action, uint32_t pointerCount, uint32_t pointerCount, const PointerProperties* pointerProperties, const PointerProperties* pointerProperties, const PointerCoords* pointerCoords, int32_t flags); const PointerCoords* pointerCoords, int32_t flags); Loading
libs/graphicsenv/GraphicsEnv.cpp +1 −2 Original line number Original line Diff line number Diff line Loading @@ -63,8 +63,7 @@ typedef bool (*fpANGLEFreeSystemInfoHandle)(void* handle); namespace { namespace { static bool isVndkEnabled() { static bool isVndkEnabled() { #ifdef __BIONIC__ #ifdef __BIONIC__ // TODO(b/290159430) Use ro.vndk.version to check if VNDK is enabled instead static bool isVndkEnabled = android::base::GetProperty("ro.vndk.version", "") != ""; static bool isVndkEnabled = !android::base::GetBoolProperty("ro.vndk.deprecate", false); return isVndkEnabled; return isVndkEnabled; #endif #endif return false; return false; Loading
libs/gui/Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -200,6 +200,7 @@ aconfig_declarations { cc_aconfig_library { cc_aconfig_library { name: "libguiflags", name: "libguiflags", host_supported: true, vendor_available: true, vendor_available: true, aconfig_declarations: "libgui_flags", aconfig_declarations: "libgui_flags", } } Loading
libs/input/Android.bp +22 −0 Original line number Original line Diff line number Diff line Loading @@ -90,6 +90,28 @@ rust_bindgen { "--allowlist-var=AMOTION_EVENT_ACTION_DOWN", "--allowlist-var=AMOTION_EVENT_ACTION_DOWN", "--allowlist-var=AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT", "--allowlist-var=AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT", "--allowlist-var=MAX_POINTER_ID", "--allowlist-var=MAX_POINTER_ID", "--allowlist-var=AINPUT_SOURCE_CLASS_NONE", "--allowlist-var=AINPUT_SOURCE_CLASS_BUTTON", "--allowlist-var=AINPUT_SOURCE_CLASS_POINTER", "--allowlist-var=AINPUT_SOURCE_CLASS_NAVIGATION", "--allowlist-var=AINPUT_SOURCE_CLASS_POSITION", "--allowlist-var=AINPUT_SOURCE_CLASS_JOYSTICK", "--allowlist-var=AINPUT_SOURCE_UNKNOWN", "--allowlist-var=AINPUT_SOURCE_KEYBOARD", "--allowlist-var=AINPUT_SOURCE_DPAD", "--allowlist-var=AINPUT_SOURCE_GAMEPAD", "--allowlist-var=AINPUT_SOURCE_TOUCHSCREEN", "--allowlist-var=AINPUT_SOURCE_MOUSE", "--allowlist-var=AINPUT_SOURCE_STYLUS", "--allowlist-var=AINPUT_SOURCE_BLUETOOTH_STYLUS", "--allowlist-var=AINPUT_SOURCE_TRACKBALL", "--allowlist-var=AINPUT_SOURCE_MOUSE_RELATIVE", "--allowlist-var=AINPUT_SOURCE_TOUCHPAD", "--allowlist-var=AINPUT_SOURCE_TOUCH_NAVIGATION", "--allowlist-var=AINPUT_SOURCE_JOYSTICK", "--allowlist-var=AINPUT_SOURCE_HDMI", "--allowlist-var=AINPUT_SOURCE_SENSOR", "--allowlist-var=AINPUT_SOURCE_ROTARY_ENCODER", ], ], static_libs: [ static_libs: [ Loading
libs/input/InputTransport.cpp +3 −3 Original line number Original line Diff line number Diff line Loading @@ -632,8 +632,8 @@ status_t InputPublisher::publishMotionEvent( MotionEvent::actionToString(action).c_str())); MotionEvent::actionToString(action).c_str())); if (verifyEvents()) { if (verifyEvents()) { Result<void> result = Result<void> result = mInputVerifier.processMovement(deviceId, action, pointerCount, pointerProperties, mInputVerifier.processMovement(deviceId, source, action, pointerCount, pointerCoords, flags); pointerProperties, pointerCoords, flags); if (!result.ok()) { if (!result.ok()) { LOG(FATAL) << "Bad stream: " << result.error(); LOG(FATAL) << "Bad stream: " << result.error(); } } Loading Loading @@ -1276,13 +1276,13 @@ void InputConsumer::resampleTouchState(nsecs_t sampleTime, MotionEvent* event, PointerCoords& resampledCoords = touchState.lastResample.pointers[i]; PointerCoords& resampledCoords = touchState.lastResample.pointers[i]; const PointerCoords& currentCoords = current->getPointerById(id); const PointerCoords& currentCoords = current->getPointerById(id); resampledCoords = currentCoords; resampledCoords = currentCoords; resampledCoords.isResampled = true; if (other->idBits.hasBit(id) && shouldResampleTool(event->getToolType(i))) { if (other->idBits.hasBit(id) && shouldResampleTool(event->getToolType(i))) { const PointerCoords& otherCoords = other->getPointerById(id); const PointerCoords& otherCoords = other->getPointerById(id); resampledCoords.setAxisValue(AMOTION_EVENT_AXIS_X, resampledCoords.setAxisValue(AMOTION_EVENT_AXIS_X, lerp(currentCoords.getX(), otherCoords.getX(), alpha)); lerp(currentCoords.getX(), otherCoords.getX(), alpha)); resampledCoords.setAxisValue(AMOTION_EVENT_AXIS_Y, resampledCoords.setAxisValue(AMOTION_EVENT_AXIS_Y, lerp(currentCoords.getY(), otherCoords.getY(), alpha)); lerp(currentCoords.getY(), otherCoords.getY(), alpha)); resampledCoords.isResampled = true; ALOGD_IF(debugResampling(), ALOGD_IF(debugResampling(), "[%d] - out (%0.3f, %0.3f), cur (%0.3f, %0.3f), " "[%d] - out (%0.3f, %0.3f), cur (%0.3f, %0.3f), " "other (%0.3f, %0.3f), alpha %0.3f", "other (%0.3f, %0.3f), alpha %0.3f", Loading