summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-04-05Merge list refactor from upstream am: f29fcceda1 am: f78de2018b am: ↵android-14.0.0_r45android-14.0.0_r44android-14.0.0_r43android-14.0.0_r42android-14.0.0_r41android-14.0.0_r40android-14.0.0_r39android-14.0.0_r38android-14.0.0_r27android-14.0.0_r26android-14.0.0_r25android-14.0.0_r24android-14.0.0_r23android-14.0.0_r22android-14.0.0_r21android-14.0.0_r20android-14.0.0_r19android-14.0.0_r18android-14.0.0_r17android-14.0.0_r16android14-qpr1-s2-releaseandroid14-qpr1-releaseandroid14-d2-s5-releaseandroid14-d2-s4-releaseandroid14-d2-s3-releaseandroid14-d2-s2-releaseandroid14-d2-s1-releaseandroid14-d2-releaseHarry Cutts
b9d4211737 am: bcae70e9f7 Original change: https://android-review.googlesource.com/c/platform/external/libchrome-gestures/+/2523978 Change-Id: Iaf39a04246abbfe4db1fdbf3843b9af182cb7676 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-05Merge list refactor from upstream am: f29fcceda1 am: f78de2018b am: b9d4211737android14-devHarry Cutts
Original change: https://android-review.googlesource.com/c/platform/external/libchrome-gestures/+/2523978 Change-Id: Ic86a5973733a9c57ef6205dd193d6f71add4f720 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-05Merge list refactor from upstream am: f29fcceda1 am: f78de2018bHarry Cutts
Original change: https://android-review.googlesource.com/c/platform/external/libchrome-gestures/+/2523978 Change-Id: I65d014e0a50e2f876c9f188ce7f4d80fef00c766 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-05Merge list refactor from upstream am: f29fcceda1Harry Cutts
Original change: https://android-review.googlesource.com/c/platform/external/libchrome-gestures/+/2523978 Change-Id: I1b25c37c6240d3c5269e25aaad33959dbde557c2 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-05Merge list refactor from upstreamandroid-u-beta-1-gplHarry Cutts
The changes pulled in here refactor the uses of linked lists in various places, one of which is being reported as a memory leak by the fuzzer. There is also a documentation improvement. Bug: b/272935568 Test: Treehugger Change-Id: Ia1d1b32c47e5d5eaa68fb5500bf9c1e1226ab869
2023-03-24Document how raised touches should be reportedHarry Cutts
It wasn't immediately clear before whether a raised touch should be reported one last time with tracking_id = -1 in its FingerState, or just dropped from the fingers array altogether. It turns out to be the latter [0], so add some comments to make that clear. Also move the information from a comment that had somehow been separated from the FingerState struct, while we're at it. [0]: https://crsrc.org/c/ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.cc;l=199;drc=3e1a26c44c024d97dc9a4c09bbc6a2365398ca2c BUG=None TEST=emerge-volteer chromeos-base/gestures Change-Id: I8325a1b9bfedaa88c9a5d15a85d1b7d1b3498e59 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4360158 Tested-by: Harry Cutts <hcutts@chromium.org> Auto-Submit: Harry Cutts <hcutts@chromium.org> Reviewed-by: Torsha Banerjee <torsha@google.com> Code-Coverage: Torsha Banerjee <torsha@google.com> Reviewed-by: Sean O'Brien <seobrien@chromium.org> Commit-Queue: Harry Cutts <hcutts@chromium.org>
2023-03-24Cleanup *_filter_interpreter.h include listDenis Brockus
Missed a nit in crrev/c/4361866 to remove the includes that are not being directly accessed. BUG=b:271591258 TEST=USE="coverage" FEATURES="test noclean" emerge-brya chromeos-base/gestures Change-Id: I0be861b846acb60c2f263db5456e87d6fc288f9c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4367481 Reviewed-by: Harry Cutts <hcutts@chromium.org> Commit-Queue: Harry Cutts <hcutts@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Code-Coverage: Harry Cutts <hcutts@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org>
2023-03-23Move list with .at into generic in util.hDenis Brockus
Instead of repeating making a class that inherits from std::list, make this gestures::List a single point of truth for this code. This is still just a std::list but adds .at() to this class. BUG=b:271591258 TEST=USE="coverage" FEATURES="test noclean" emerge-brya chromeos-base/gestures Change-Id: Id612a6501d5caabea8195b8a14c76c28dcaced5a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4361866 Code-Coverage: Henry Barnor <hbarnor@chromium.org> Reviewed-by: Harry Cutts <hcutts@chromium.org> Reviewed-by: Sean O'Brien <seobrien@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
2023-03-23Remove std::optional<std::wrapped_reference>> from .at()Denis Brockus
There was a desire to move to use either a pointer or a normal reference. The original .at() returned a normal reference but did not allow for offsets that were out of bounds. I went back to this original and used an abort for the invalid offset. I added a death test in util_unittest to verify that was working. BUG=b:271591258 TEST=USE="coverage" FEATURES="test noclean" emerge-brya chromeos-base/gestures Change-Id: Ie6a6716f23d5c8516dab7801098e7f4d60b00bee Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4357694 Reviewed-by: Harry Cutts <hcutts@chromium.org> Code-Coverage: Henry Barnor <hbarnor@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
2023-03-23Removal cleanup of MemoryManagedListDenis Brockus
Remove MemoryManager Remove MemoryManagedList Remove utils RemoveMissingIdsFromMap that passes removed map BUG=b:271591258 TEST=USE="coverage" FEATURES="test noclean" emerge-brya chromeos-base/gestures Change-Id: I30686b6e353327066ddc4c8ef496fd51ef6a36dc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4357693 Auto-Submit: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Harry Cutts <hcutts@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Code-Coverage: Henry Barnor <hbarnor@chromium.org>
2023-03-23trend_classifying_filter_interpreter: remove MemoryManagedListDenis Brockus
Remove all references of MemoryManager Remove all references of MemoryManagedList Follow the mechanism in LookaheadFilterInterpreter crrev/c/4334918 BUG=b:271591258 TEST=USE="coverage" FEATURES="test noclean" emerge-brya chromeos-base/gestures Change-Id: Ie3774ec0596e96571617b2775ced719b639dd536 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4357692 Code-Coverage: Henry Barnor <hbarnor@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Harry Cutts <hcutts@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org>
2023-03-22tools: Use json instead of simplejsonGwendal Grignou
python we are using have json built-in. Use it to not depend on simplejson package. BUG=b:187794810 TEST=Run unit test, but fails at: "/mnt/host/source/src/platform/mttools/mtreplay/replay: error while loading shared libraries: libevdev_hollow.so.0: cannot open shared object file: No such file or directory" Change-Id: I27f034d10e24814f0d2e1ef3fdb15d19a25d5a6c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4300256 Code-Coverage: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Sean O'Brien <seobrien@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org> Code-Coverage: Sean O'Brien <seobrien@chromium.org>
2023-03-21metrics_filter_interpreter: remove the use of MemoryManagedListDenis Brockus
Remove all references of MemoryManager Remove all references of MemoryManagedList Follow the mechanism in LookaheadFilterInterpreter crrev/c/4334918 BUG=b:271591258 TEST=USE="coverage" FEATURES="test noclean" emerge-brya chromeos-base/gestures Change-Id: Ia2ca7ef7db0d44f880b969a6e0babf92c508f244 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4348019 Commit-Queue: Harry Cutts <hcutts@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Harry Cutts <hcutts@chromium.org> Code-Coverage: Harry Cutts <hcutts@chromium.org>
2023-03-21Move Lookahead list.at() processing to common utilitiesDenis Brockus
BUG=b:271591258 TEST=USE="coverage" FEATURES="test noclean" emerge-brya chromeos-base/gestures Change-Id: Ief01adbe704e69704efad3af241b7a1b88d3e220 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4352450 Reviewed-by: Harry Cutts <hcutts@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Code-Coverage: Harry Cutts <hcutts@chromium.org> Commit-Queue: Harry Cutts <hcutts@chromium.org>
2023-03-21Add ListAt to the gesture utilitiesDenis Brockus
BUG=b:271591258 TEST=USE="coverage" FEATURES="test noclean" emerge-brya chromeos-base/gestures Change-Id: Ie95a888ddccb16255db75f3e99436896ef367016 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4352449 Code-Coverage: Harry Cutts <hcutts@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Harry Cutts <hcutts@chromium.org> Reviewed-by: Harry Cutts <hcutts@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org>
2023-03-15lookahead_filter_interpreter: use std::list<QState>Denis Brockus
Using std::list<QState> directly instead of using a pointer std::list<QState*> with the extra code to manage a free_list_ BUG=b:271591258 TEST=USE="coverage" FEATURES="test noclean" emerge-brya chromeos-base/gestures Change-Id: I5d086d4826fef83105ce71d37c8002422c8f5ad2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4334918 Reviewed-by: Kenneth Albanowski <kenalba@google.com> Code-Coverage: Henry Barnor <hbarnor@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Harry Cutts <hcutts@chromium.org> Code-Coverage: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Henry Barnor <hbarnor@chromium.org>
2023-03-10Merge latest patches from upstream am: fdad07cb6e am: 771b6d93c6 am: ↵Harry Cutts
6c1bd82791 am: 20ab3e76e3 Original change: https://android-review.googlesource.com/c/platform/external/libchrome-gestures/+/2480579 Change-Id: Ic0de857d6ee2664e52681b255df27ec08c38eef5 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-10Merge latest patches from upstream am: fdad07cb6e am: 771b6d93c6 am: 6c1bd82791Harry Cutts
Original change: https://android-review.googlesource.com/c/platform/external/libchrome-gestures/+/2480579 Change-Id: I0051830c62d5e48b3723663d5e3aebd5ac7f876b Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-10Merge latest patches from upstream am: fdad07cb6e am: 771b6d93c6Harry Cutts
Original change: https://android-review.googlesource.com/c/platform/external/libchrome-gestures/+/2480579 Change-Id: Ibc494acc9efc07f02101121a23216f5399e780b0 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-10Merge latest patches from upstream am: fdad07cb6eHarry Cutts
Original change: https://android-review.googlesource.com/c/platform/external/libchrome-gestures/+/2480579 Change-Id: Iafac8603922e863bb3d5e26f3b2a0c671c940b7c Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-10Merge latest patches from upstreamHarry Cutts
This pulls in: * a fix for touchpads which don't report X and Y resolution (fixing some issues with Sony gamepad touchpads); * upgrade to C++17; * replacement of the built-in list implementation; and * an improvement to the way property delegates are set. Bug: 251196347 Bug: 246587538 Test: Treehugger Change-Id: Ic7d97cc7d384149512553601461df238a107f61e
2023-03-09scaling: Default to 32 units/mm if X/Y resolution isn't specifiedHarry Cutts
Previously it would just be 0, causing the scales to be infinity and any touch positions output from ScalingFilterInterpreter to be NaN. Looking at the resolutions reported by various Chromebook touchpads, 32 seems to be a reasonable default, especially for the sort of low-end touchpad that wouldn't specify a resolution. BUG=b:246587538 TEST=(On Android) Connect a Sony DualShock 4 or DualSense controller, confirm that the cursor etc. now responds to gestures; run unit tests Change-Id: I50e516d17948aa6e0bbd6ec7532048b7345d223c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4324037 Commit-Queue: Harry Cutts <hcutts@chromium.org> Tested-by: Harry Cutts <hcutts@chromium.org> Code-Coverage: Sean O'Brien <seobrien@chromium.org> Reviewed-by: Sean O'Brien <seobrien@chromium.org>
2023-03-08Remove homebrew List implementationDenis Brockus
Use std::list instead of gestures::List Include helper function where needed for .at needs Changed LookaheadFilterInterpreter::free_list_ to be a vector Added QStateList test for coverage improvement BUG=b:270612476 TEST=USE="coverage" FEATURES="test noclean" emerge-brya chromeos-base/gestures Change-Id: I0857ff48f8d386f15b887d25349c734f2710f946 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4303073 Auto-Submit: Denis Brockus <dbrockus@chromium.org> Code-Coverage: Henry Barnor <hbarnor@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Harry Cutts <hcutts@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org>
2023-03-07tools: Fix license headerGwendal Grignou
BUG=none TEST=Check repo --verify is not complaining anymore. Change-Id: Ia90fced35f679a52c76c78ad4a2ab80fce0ce64e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4300260 Reviewed-by: Harry Cutts <hcutts@chromium.org> Code-Coverage: Harry Cutts <hcutts@chromium.org> Commit-Queue: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org>
2023-03-03upgrades to C++17Christopher Di Bella
ChromeOS is looking to move to C++20, and the gtest 1.13.0 C++14 as a minimum version. This commit skips C++14 in favour of C++17 so that we can identify any C++17-only blockers on the path toward C++20. BUG=b:271475511 TEST=CQ Change-Id: I3caa4de306b9fd9d792fde609003c248dc76639f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4304668 Code-Coverage: Henry Barnor <hbarnor@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Harry Cutts <hcutts@chromium.org> Commit-Queue: Christopher Di Bella <cjdb@google.com> Auto-Submit: Christopher Di Bella <cjdb@google.com> Tested-by: Christopher Di Bella <cjdb@google.com>
2023-03-02Remove Property constructor delegateDenis Brockus
The delegate used for the Property constructor was most frequently set to 'this' which in many cases had not been completely initialized at the point it was passed. By not passing a delegate into the Property constructor it will eliminate the possibility that 'this' was passed before it was initialized. Make changes to Property uses to fit this new mechanism. BUG=b:253585974 TEST=USE="coverage" FEATURES="test noclean" emerge-brya chromeos-base/gestures Change-Id: I1751163a3b945a6517e614ee720e7e1a3c49174e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4295788 Commit-Queue: Harry Cutts <hcutts@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Code-Coverage: Harry Cutts <hcutts@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Harry Cutts <hcutts@chromium.org>
2023-02-28Merge leak fix and logging changes from upstream am: 37db0484f7 am: ↵Harry Cutts
d5316da5a8 am: 6563876e48 am: 22c5cd7bfe Original change: https://android-review.googlesource.com/c/platform/external/libchrome-gestures/+/2456012 Change-Id: I5b4ca9f75f40caef5e38f98f3f01513e1983c5f0 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-28Merge leak fix and logging changes from upstream am: 37db0484f7 am: ↵Harry Cutts
d5316da5a8 am: 6563876e48 Original change: https://android-review.googlesource.com/c/platform/external/libchrome-gestures/+/2456012 Change-Id: Ie5bece1cfae9a1f4fd5b5f3882114b7b40ad7d58 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-28Merge leak fix and logging changes from upstream am: 37db0484f7 am: d5316da5a8Harry Cutts
Original change: https://android-review.googlesource.com/c/platform/external/libchrome-gestures/+/2456012 Change-Id: I5a524d8df85636794e0adb3efeab12efabc8c5d4 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-28Merge leak fix and logging changes from upstream am: 37db0484f7Harry Cutts
Original change: https://android-review.googlesource.com/c/platform/external/libchrome-gestures/+/2456012 Change-Id: I206767070e0c3fabdccbd52197df9ecbdd9c1685 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-27Merge leak fix and logging changes from upstreamHarry Cutts
This also pulls in some improvements to the way properties are initialized, potentially preventing crashes (though not ones that have been observed on Android yet). Bug: 266848195 Bug: 251196347 Test: TreeHugger Change-Id: I78ff5fb20f2c5dfe81435b8f41168af60e88b665
2023-02-24List: free allocated memory in DeleteAllHarry Cutts
This fixes a memory leak from LookaheadFilterInterpreter, where the pointers contained in the list were not being freed on destruction. Since LookaheadFilterInterpreter is the only user of List (as opposed to MemoryManagedList), make freeing the memory the default behaviour. BUG=b:266848195 TEST=fuzzer with testcase from b/266848195; unit tests; regression tests Change-Id: Ifd81635cad9cf2fd7119c2e87433a3aaa5ba5dac Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4290136 Commit-Queue: Harry Cutts <hcutts@chromium.org> Tested-by: Harry Cutts <hcutts@chromium.org> Reviewed-by: Sean O'Brien <seobrien@chromium.org> Code-Coverage: Sean O'Brien <seobrien@chromium.org>
2023-02-24Late delegate setting to avoid init order issuesDenis Brockus
When a Property is created, initialized in the constructor initialization list, and uses 'this' as the delegate, there can be an ordering issue where the delegate gets called that can use the Property before it is initialized, possibly causing a crash. The recommended method to initialize a Property of this type is to create the Property without the delegate and then in the Constructor body, after the object is fully initialized, set the delegate. This will follow the same execution path as setting the delegate in the initialization list, including calling the appropriate WasWritten method, but eliminates the possibility the Property will be used before it is initialized. BUG=b:253585974 TEST=USE="coverage" FEATURES="test noclean" emerge-brya chromeos-base/gestures Change-Id: Ia658ea903656d5ad6be638ca0d49b169cfe3127c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4286619 Code-Coverage: Kenneth Albanowski <kenalba@google.com> Commit-Queue: Kenneth Albanowski <kenalba@google.com> Reviewed-by: Kenneth Albanowski <kenalba@google.com> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org>
2023-02-23Add spaces to start of log messages by defaultHarry Cutts
Previously adding a call like Log("Foo") would result in a message like: INFO:external/libchrome-gestures/src/src_file.cc:123:Foo Whereas you'd normally expect a space to be added, like: INFO:external/libchrome-gestures/src/src_file.cc:123: Foo This makes the logs scan better, too. BUG=none TEST=use the touchpad a bit and watch the library logs Change-Id: I69ea1b5f4bf7632d137cc62d1ce3776b9f78efbc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4275523 Tested-by: Harry Cutts <hcutts@chromium.org> Reviewed-by: Sean O'Brien <seobrien@chromium.org> Code-Coverage: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Harry Cutts <hcutts@chromium.org>
2023-02-23Only complain about missing timer provider onceHarry Cutts
On Android we currently don't use a timer provider. The library is still working well, but reports a "No timer!" error for every hardware state that's pushed, which rather spams the Android logcat. It only really needs to be reported the first time. BUG=b:251196347 TEST=Watch logcat "Gestures" tag on Android while using the touchpad for the first time, check the new error message appears only once Change-Id: I94556a9d5ef5c0e14284a807b9337ac8e8aeb686 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4275522 Code-Coverage: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Harry Cutts <hcutts@chromium.org> Reviewed-by: Sean O'Brien <seobrien@chromium.org> Tested-by: Harry Cutts <hcutts@chromium.org>
2023-02-23Remove duplicate Property constructorsDenis Brockus
Using a default value for the delegate of NULL serves the same purpose of duplicating each one. Changed the test to use the default NULL delegate, so don't specifically include that as a parameter. BUG=b:253585974 TEST=USE="coverage" FEATURES="test noclean" emerge-brya chromeos-base/gestures Change-Id: I332d0ac3e401c25b3a44e608fb9308efa493b0b9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4283085 Code-Coverage: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Kenneth Albanowski <kenalba@google.com> Tested-by: Kenneth Albanowski <kenalba@google.com> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Code-Coverage: Kenneth Albanowski <kenalba@google.com> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
2023-02-13Merge remote-tracking branch 'aosp/upstream-main' into merge am: 402ba203f4 ↵Ben Murdoch
am: 6b6f1324bc am: 5b030381fd Original change: https://android-review.googlesource.com/c/platform/external/libchrome-gestures/+/2430752 Change-Id: I05a38ba56d3f11e40414e10a647c466fec88dc01 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-13Merge remote-tracking branch 'aosp/upstream-main' into merge am: 402ba203f4 ↵Ben Murdoch
am: 6b6f1324bc Original change: https://android-review.googlesource.com/c/platform/external/libchrome-gestures/+/2430752 Change-Id: I65576cd9675ea772bca33cc4ab719d5f5994e3ba Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-13Merge remote-tracking branch 'aosp/upstream-main' into merge am: 402ba203f4Ben Murdoch
Original change: https://android-review.googlesource.com/c/platform/external/libchrome-gestures/+/2430752 Change-Id: I70c68b0c327d528ae9fc3a23d6c8db9e82414e3e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-10Merge remote-tracking branch 'aosp/upstream-main' into mergeBen Murdoch
Bug: 251196347 Bug: 267421392 Test: Treehugger Change-Id: I64486b9250fe98558cf2a50ab84fe28a8927790f
2023-02-09Document dx/dy sign for moves, scrolls, and swipesHarry Cutts
Which direction is meant by a negative or positive value appears to be quite inconsistent between the various gesture types. As far as I can tell, this is due to the history of how scrolling and its settings were handled in the past. Adding comments stating which direction is indicated by which sign of number (from observations of the gestures reported when running on Android) should at least make this documented confusion, rather than just confusion. BUG=None TEST=Verify the information against logs of reported gestures Change-Id: Ie045deaa3610389aba5605c015760283cf7b6d12 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4166157 Tested-by: Harry Cutts <hcutts@chromium.org> Code-Coverage: Torsha Banerjee <torsha@google.com> Commit-Queue: Harry Cutts <hcutts@chromium.org> Reviewed-by: Sean O'Brien <seobrien@chromium.org>
2023-02-08Fix bad pointer in ImmediateInterpreter PinchTestsHarry Cutts
`finger_states` only has 32 entries, meaning `&finger_states[32]` points outside the array. This was causing a crash when the test was run on an Android device with hwasan enabled. It appears that this issue has been present since the test was first written, Replacing it with `&finger_states[30]` keeps the test passing and fixes the hwasan crash. BUG=b:267421392 TEST=in CrOS SDK chroot: $ cros_workon_make --board=volteer --test chromeos-base/gestures TEST=with Android, on a hwasan build: $ atest libchrome-gestures_test:ImmediateInterpreterTest#PinchTests Change-Id: I1ab97ff8e694cdadc7c6d87943f8fb39c83eee27 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4228006 Code-Coverage: Denis Brockus <dbrockus@chromium.org> Tested-by: Harry Cutts <hcutts@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Sean O'Brien <seobrien@chromium.org> Commit-Queue: Harry Cutts <hcutts@chromium.org>
2023-01-13Merge remote-tracking branch 'aosp/upstream-main' into gestures-update am: ↵Harry Cutts
0d4e0160ef am: 9381183ad9 am: d5932c5d0a Original change: https://android-review.googlesource.com/c/platform/external/libchrome-gestures/+/2388113 Change-Id: Ic9c05896b8bed693dd0067862f2c92ad32f63dfb Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-13Merge remote-tracking branch 'aosp/upstream-main' into gestures-update am: ↵Harry Cutts
0d4e0160ef am: 9381183ad9 Original change: https://android-review.googlesource.com/c/platform/external/libchrome-gestures/+/2388113 Change-Id: I6e74a86df802c1ad259b063256e229f248766463 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-13Merge remote-tracking branch 'aosp/upstream-main' into gestures-update am: ↵Harry Cutts
0d4e0160ef Original change: https://android-review.googlesource.com/c/platform/external/libchrome-gestures/+/2388113 Change-Id: I9ab04f68154f943ac5665f683f19929a3cbe4bf0 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-13Merge remote-tracking branch 'aosp/upstream-main' into gestures-updateplatform-tools-34.0.0platform-tools-33.0.4main-16k-with-phonesHarry Cutts
The main change we need here is the addition of the "Invert Scrolling" property. The other changes are documentation and test coverage fixes. Bug: 251196347 Test: Treehugger Change-Id: Ifde19527eb0ff0322aa0bd988333d449f992789a
2023-01-13Clarify who should call gesture property get and set handlersHarry Cutts
When reading through the existing comment, it wasn't clear to me whether the library or the client was responsible for calling these handlers. BUG=b:251196347 TEST=none Change-Id: Id9b573ed801637f57da67a8d51b91fe68910e032 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4151717 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Tested-by: Harry Cutts <hcutts@chromium.org> Reviewed-by: Sean O'Brien <seobrien@chromium.org> Commit-Queue: Harry Cutts <hcutts@chromium.org>
2023-01-13docs: Clarify situation with read-only propertiesHarry Cutts
Though the comments in gestures.h talk about read-only properties where loc is null, these are actually only used by Chromium creating its own properties. Clarify that other clients don't need to support them. BUG=b:251196347 TEST=none Change-Id: Ie3c8125cc7de4a8b31db7661e9180f9defdd3024 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4151716 Reviewed-by: Sean O'Brien <seobrien@chromium.org> Commit-Queue: Harry Cutts <hcutts@chromium.org> Tested-by: Harry Cutts <hcutts@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
2023-01-13Deprecate GesturesPropProvider::create_short_fnHarry Cutts
The infrastructure for short properties was removed in 2020 [0], so this function wasn't being called. Make clear that it's not used any more and can be null. [0]: https://crrev.com/c/1988601 BUG=b:251196347,b:265022208 TEST=cros_workon_make --board=volteer --test chromeos-base/gestures (both with and without changes to src/prop_registry_unittest.cc) Change-Id: I46fa33a1d18ed689474b4cf9cc4081d21e910991 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4151715 Tested-by: Harry Cutts <hcutts@chromium.org> Commit-Queue: Harry Cutts <hcutts@chromium.org> Reviewed-by: Sean O'Brien <seobrien@chromium.org>
2023-01-13scaling: add "Invert Scrolling" propertyHarry Cutts
There is already an "Australian Scrolling" property for changing scroll direction, but it also changes the Y direction for three- and four-finger swipes, which is not the desired behaviour on Android. The "Invert Scrolling" property only affects scrolling. BUG=b:251196347 TEST=set the property to true with gesture properties service, check scroll directions; run unit tests Change-Id: Iecf7338fd67bed94cb7af4486c3c688c0b20ed5c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4161598 Reviewed-by: Sean O'Brien <seobrien@chromium.org> Commit-Queue: Harry Cutts <hcutts@chromium.org> Tested-by: Harry Cutts <hcutts@chromium.org>