Commit graph

330 commits

Author SHA1 Message Date
Lais Andrade
c689ba5ed2 Fix flaky VTS for vibration completion callback
Update assertions on vibration completion callback to use a fixed
timeout of 100ms. Tests are flaky on cuttlefish, which indicates it's
not hardware latency causing it.

Fix: 333639794
Test: atest VtsHalVibratorTargetTest
Change-Id: I986cdd8087895fc0694d689e70feef0a9fe4140e
2024-04-10 11:07:11 +01:00
Lais Andrade
db8ffbb077 Remove cleanup after bench loop from setAmplitude test
Fix error on waiting for long vibration callback that might have been
already cleared by the HAL when vibration finished. Test run crash log:

FORTIFY: pthread_mutex_lock called on a destroyed mutex (0xf5a83bbc)

Keep all test cleanup logic in teardown methods.

Bug: 329899022
Change-Id: If7c13296b870e792063a9ad7b307d57fb5c333aa
Test: atest VibratorHalIntegrationBenchmark
2024-03-26 12:03:10 +00:00
Lais Andrade
59a5d543b0 Fix binder transaction errors on vibrator benchmark tests
Setup binder process thread pool for vibrator HAL benchmark tests to fix
binder transaction errors of the type:

E Vibrator: Failed completion callback: -129

This change also adds checks for HAL results, which will cause them to
fail earlier with a useful error message when the device reaches a bad
state. This should avoid timeout failures for the whole test suite.

Other fixes:

- Fix vibrator.on(ms) tests to use a valid max duration value
  (previously failing with illegal argument);
- Use a smaller fixed # of iterations on tests that iterate on vibrate
  calls, and add wait for vibration to be complete to measure the HAL
  in a more stable state;
- Skip getSupportedAlwaysOnEffects on devices without capability;

Fix: 329239120
Bug: 329899022
Bug: 329203383
Test: atest VibratorHalIntegrationBenchmark
Change-Id: Id541a62745320a601934fd3f176f8ba42b5a7b2d
2024-03-20 13:54:13 +00:00
Lais Andrade
661481edf1 Remove uses of std::rand() from vibrator VTS tests
Make vibrator VTS tests deterministic by removing all uses of
std::rand() from HAL input values used in test. Rely on max supported
values instead.

Fix: 324840028
Test: atest VtsHalVibratorTargetTest
Change-Id: Id40fb5a86238226feec9affff631bab37383f26b
2024-02-12 16:00:40 +00:00
Treehugger Robot
e870ecf089 Merge "Fix vibrator compose VTS tests" into main 2024-02-12 11:15:38 +00:00
Lais Andrade
38d054e4ae Fix vibrator compose VTS tests
Add TearDown method to reset the vibrator state between tests to avoid
illegal state errors caused by unrelated tests.

Add calls to vibrator->off between vibrator->compose invocations within
the same test, so calls are tested individually.

Test runs with this change on failing targets:

Bug: 323087313
Test: atest VtsHalVibratorTargetTest
Change-Id: I1e9aa243da07040b33df2474977fc8becac440a5
2024-02-12 10:27:24 +00:00
Adrian Roos
77659428e3 vibrator HAL bench: Fix broken benchmarks
Fixes an issue with the benchmarks, where they would skip unsupported
situations by early returning without reaching the measure loop and
without notifying the framework.

The framework would then retry the exact same scenario indefinitely.

To fix, makes sure every early return also calls SkipWithMessage.

Fixes: 302845046
Test: adb shell /tmp/foobar/VibratorHalIntegrationBenchmark --v=2
Change-Id: Ib52b8c4d94755a0961bcfb40d508482e5c49cb52
2024-02-09 19:49:32 +00:00
Aditya Choudhary
ad2ba1b851 [DON'T BLOCK] Test ownership migration rules
This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.

For more details please refer to the link below,
go/new-android-ownership-model

Bug: 304529413
Test: N/A
Change-Id: Ic8c4bd6ac246e7efa98bbdaf822d12ae8e1230a5
2024-02-05 15:45:22 +00:00
Aditya Choudhary
c5c6c62995 [DON'T BLOCK] Test ownership migration rules
This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.

For more details please refer to the link below,
<add g3 doc link>

Bug: 304529413
Test: N/A
Change-Id: I3322344f595f974f730dc824af0110388076d838
2024-01-31 11:06:17 +00:00
Jooyung Han
62ba8b5bbe Merge "Cleanup: use shared apex_key (vibrator HAL APEX)" into main 2023-10-16 01:19:52 +00:00
Jooyung Han
83f5cfc36d Cleanup: use shared apex_key (vibrator HAL APEX)
plus, moved VINTF fragment into VAPEX

Bug: 296524155
Test: m
Change-Id: I1453174ab8229af56cff5886126de77eb9129ed7
2023-10-10 16:08:22 +09:00
Lais Andrade
ecc4631caa Update haptics framework owners file
Bug: 304194677
Change-Id: I387ac57b76dd2aab19d485a1964927be3d709009
Test: N/A
2023-10-09 11:55:22 +00:00
Steven Moreland
5320579222 Revert "Revert "vib example client on product"" am: 3e776b9e04 am: b192b1cec2 am: a38302413a
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2475244

Change-Id: I23e9eb183419b43cfcf39e74379763071f06affa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-14 00:59:29 +00:00
Steven Moreland
3e776b9e04 Revert "Revert "vib example client on product""
This reverts commit 29254e1e23.

It includes a fix for product apps for the targets without
PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE=true.

Reason for revert: reland from partner questions with a fix
Bug: b/271988499 # asked again
Test: TARGET_PRODUCT=ndk build/soong/soong_ui.bash --make-mode --soong-only out/soong/ndk.timestamp

Change-Id: I066eb75274c291cf832ad9847c0a4623af797f41
2023-03-13 22:29:13 +00:00
Tai Kuo
a25e3671b4 Merge "vibrator: update OWNERS" am: 67ff3b4c3c am: b590aa27b6 am: 08fe6036bf
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2473784

Change-Id: Id346d4f6998402aa1a0c02da486002a83c89e636
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-07 07:48:19 +00:00
Tai Kuo
cda7c33620 vibrator: update OWNERS
Bug: 271938764
Test: n/a
Change-Id: I8e69d48c46b377c1dcc9452fdd8cbb1e121940e0
2023-03-07 11:56:38 +08:00
Teo Georgescu
9fc9f82a3a Merge "Revert "vib example client on product"" am: e829d02013 am: 410b8675b4 am: 36e54cd096
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2386052

Change-Id: I8e93a42cb054499dbeeca7fb86150e696c5294ad
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-12 13:36:16 +00:00
Teo Georgescu
29254e1e23 Revert "vib example client on product"
This reverts commit f2ff92f3e0.

Reason for revert: DroidMonitor: Potential culprit for Bug b/265255626 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: I30f87a33803d00c03f9472a77ba73479c06044b0
2023-01-12 09:43:12 +00:00
Treehugger Robot
e3d6ae8e98 Merge "vib example client on product" am: 87804b1f2d am: cbbf61cb68 am: ca275c95bc
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2380655

Change-Id: I34fad06f46cea16ca721de2fce446c35c78e2333
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-12 09:39:18 +00:00
Steven Moreland
f2ff92f3e0 vib example client on product
Bug: partner question
Test: # PRODUCT_PACKAGES += ExampleVibratorJavaProductClient
    adb root
    adb setenforce 0 # for find permission
    adb shell am start -n example.vib/example.vib.MyActivity
    # vibrator works

Change-Id: Ie70f4cfe0f546a43a5d11bbdd1f1143d817aab50
2023-01-11 01:41:48 +00:00
Treehugger Robot
4e8a3fdffb Merge "vibrator: clean OWNERS" am: 3e8c0ea468 am: 1e6fb9e996 am: 9d77410609
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2372271

Change-Id: I740c7a1d1c1cc20a16065135d1615b4884be0600
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-04 02:40:06 +00:00
Steven Moreland
581e0135aa vibrator: clean OWNERS
I wrote a script for it.

Bug: N/A
Test: N/A
Change-Id: I459d19c9ef798755ab5c2d9085986ba04c4a2d9d
2023-01-03 23:53:54 +00:00
Nathan Kulczak
0d1929162f vibrator/vts: Update tests for short durations
Add minimum wait time for effect completion. Effects with short
durations were not completing in time with current wait time estimation.

Bug: 240946208
Test: Ran updated tests
Change-Id: I40f65244c3478fb2f0a3b84c3991313ad5e28cd9
Signed-off-by: Nathan Kulczak <nathankulczak@google.com>
2022-12-20 18:22:23 +00:00
Steven Moreland
89c4d48e09 Merge "easy vib. instance name" am: 92f223a9cc
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2322764

Change-Id: I10c5e0a739cdf0eb6ac40bd3c80e13694c88a6f0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-01 22:02:04 +00:00
Steven Moreland
92f223a9cc Merge "easy vib. instance name" 2022-12-01 21:33:56 +00:00
Steven Moreland
b5e0adbeb2 easy vib. instance name
Bug: 257537714
Test: vts_treble_vintf_vendor_test after using this
Change-Id: Id0c56b2df59eb854a5f62d8adc65d0a6b38fcd3c
2022-12-01 01:25:15 +00:00
Steven Moreland
aebd7e6bb7 Merge "example vendor app" am: e49b3684a1
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2308365

Change-Id: Ibd9e0647157da27d64c041e14e97635422415ad2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-21 18:26:08 +00:00
Steven Moreland
0385dac9fc example vendor app
see comments added in code and Android.bp

We don't have examples of a common Android ecosystem usecase, so
I'm adding one here.

Bug: 227289255
Test: after sepolicy + PRODUCT_PACKAGES:
    11-19 03:14:27.460   488   488 I android.hardware.vibrator-service.example: Vibrator on for timeoutMs: 100
Change-Id: Iee430d85e23c6c8f771dc5aa77bff9be1a91f080
2022-11-19 03:35:37 +00:00
TreeHugger Robot
62bee20d8e Merge "Fix VtsHalVibratorManagerTargetTest test fail" into tm-qpr-dev am: d39f11cbb0
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/19992878

Change-Id: I5055ea6c6fad217f9ede8af0ce7e30372bdedc0a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-21 21:30:18 +00:00
Chase Wu
8fb96d255e Fix VtsHalVibratorManagerTargetTest test fail
Adding the cancelSynced() once prepareSynced() was called and return ok.

Fix: 247687286
Test: atest VtsHalVibratorManagerTargetTest
Signed-off-by: Chase Wu <chasewu@google.com>
Change-Id: I91e08e92cb8e1399eb6acdbedf95958fbf44c393
2022-09-21 11:48:40 +08:00
Pawan
70066b2383 Updating cc_fuzz with default config am: 8e13f2ac2c am: a9974359b4 am: 3753e1d8e7 am: 01c2ea1f3a
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2190582

Change-Id: I3eb09ead9b7edf9c4f254df90ae75250f845b6c3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-23 23:04:17 +00:00
Pawan
8e13f2ac2c Updating cc_fuzz with default config
Using service_fuzzer_defaults in
	- android.hardware.health-service.aidl_fuzzer
	- android.hardware.vibrator-service.example_fuzzer

Bug: 240318902
Test: m android.hardware.health-service.aidl_fuzzer
Test: m android.hardware.vibrator-service.example_fuzzer
Change-Id: I3fd1cf37a5835ebef14658ed40332132cec07e49
2022-08-22 22:16:41 +00:00
Donghong Weng
aca6491feb Merge "Explicit conversion" am: 160a22f49e am: 3c745ce814 am: 33e9c08107 am: 3aa5895a2f
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2186215

Change-Id: Idaad6f2b39142fe7202cd5a903b0e67f5c97f4d0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-22 03:01:50 +00:00
Donghong Weng
160a22f49e Merge "Explicit conversion" 2022-08-22 01:45:35 +00:00
donghongweng
af442b177f Explicit conversion
Test: m tests
Change-Id: Ie0c00a51dee1d97239b0ef6f29334d176ddec32a
2022-08-17 06:59:51 +00:00
Jooyung Han
fcef58a22a Merge "Remove AIDL-libs from VNDK" into tm-dev-plus-aosp am: 212b1e7610 am: fdc3418cc9
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/18869738

Change-Id: I7079ebd194212fd82891b2210f6a4df8d1c8bfa8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-16 01:54:37 +00:00
Jooyung Han
d81d6a12be Remove AIDL-libs from VNDK
Some are still in VNDK because they are used in other VNDK libs.

Bug: 234181591
Test: m
Merged-In: If999df9c78a20df931177da11742b1c5de19bc08
Change-Id: If999df9c78a20df931177da11742b1c5de19bc08
2022-06-14 16:42:42 +09:00
Jooyung Han
c0b24f4f13 Remove AIDL-libs from VNDK
Some are still in VNDK because they are used in other VNDK libs.

Ignore-AOSP-First: some libs are still in internal master only.

Bug: 234181591
Test: m
Merged-In: If999df9c78a20df931177da11742b1c5de19bc08
Change-Id: If999df9c78a20df931177da11742b1c5de19bc08
(cherry picked from commit 5527adfd7f)
2022-06-14 14:08:59 +09:00
Treehugger Robot
55a93f6c79 Merge "vibrator: turn off vibrator after testing ChangeVibrationAmplitude" am: 05eb1a279b am: fa0ac0f30c am: 70d2180d62 am: 8cc45e8b18
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2104024

Change-Id: Ia4f8c02105a85075f97dddbdc826921edc406e55
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-08 15:45:50 +00:00
Treehugger Robot
70d2180d62 Merge "vibrator: turn off vibrator after testing ChangeVibrationAmplitude" am: 05eb1a279b am: fa0ac0f30c
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2104024

Change-Id: Ie43d991e7d0a79be679b8bf64ae1922c499d6921
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-08 14:53:56 +00:00
Treehugger Robot
05eb1a279b Merge "vibrator: turn off vibrator after testing ChangeVibrationAmplitude" 2022-06-08 13:48:44 +00:00
Simon Bowden
608655b450 Use a shared ref for Vibrator when passed to a worker thread.
To try to protect against this easy mistake, I removed the implicit
capture from thread lambdas.

Bug: 228523213
Test: atest
Change-Id: I8fa37dacb4acf89848a8b17db8db317a988809d4
2022-06-01 12:15:42 +00:00
Fenglin Wu
a464fb4db6 vibrator: turn off vibrator after testing ChangeVibrationAmplitude
Turn off vibrator explicitly after testing ChangeVibrationAmplitude.

Bug: 232319176
Test: VtsHalVibratorTargetTest
Change-Id: I482ea8266378636340c614eda832f4237d22e005
2022-05-24 09:02:58 +08:00
Lais Andrade
f1b4dd3f1d Check primitive duration is positive for supported primitives
Bug: 203629838
Fix: 231486866
Test: VtsHalVibratorTargetTest
Signed-off-by: chasewu <chasewu@google.com>
Change-Id: I2e534f4589c9f594884385a99051c06f518103f7
Merged-In: I2e534f4589c9f594884385a99051c06f518103f7
2022-05-16 16:14:46 +08:00
chasewu
22cb901d1a Correct the PWLE valid duration
Getting the maximum duration from HAL to avoid
different supported duration under different devices.

Fix: 231486866
Test: atest VtsHalVibratorTargetTest
Signed-off-by: chasewu <chasewu@google.com>
Change-Id: I02e96869d9a8e6d5143ae64e3a077bf90dcdb43e
Merged-In: I02e96869d9a8e6d5143ae64e3a077bf90dcdb43e
2022-05-11 15:58:46 +08:00
Treehugger Robot
942f0c579b Merge "Build with upstream lld: Fix incorrect static dependencies" am: 9f18cbd7f6 am: 67a2c6d6f1 am: 8fea839883
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2061768

Change-Id: I70b59b3a2197a73415c1ca91b84df1848b14a380
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-13 22:46:33 +00:00
Pirama Arumuga Nainar
3be0ec611f Build with upstream lld: Fix incorrect static dependencies
Bug: http://b/197965342

Remove unnecessary `static_libs` dependencies or move them to
`shared_libs` to build with upstream LLD.  See b/197965342#comment1
(internal) for rationale.  Some info is available externally at
https://github.com/llvm/llvm-project/issues/42899.

Per go/android-lld-static-lib-fix, OWNERS are added for visibility.  No
action is needed if the change looks good.  This change will be merged
after two business days with Global Approvers.

Test: Build modules with aosp/2036867 in addition to presubmit
Change-Id: Id3ec5d188d7d0ae364e52b98fb9cf7221274665a
2022-04-11 20:04:20 +00:00
chasewu
a266b2c8f2 Correct the PWLE valid duration
Getting the maximum duration from HAL to avoid
different supported duration under different devices.

Fix: 227606057
Test: atest VtsHalVibratorTargetTest
Signed-off-by: chasewu <chasewu@google.com>
Change-Id: I02e96869d9a8e6d5143ae64e3a077bf90dcdb43e
2022-03-31 23:59:40 +08:00
chasewu
70da3cc0a1 Fix the maximum frequency value calculation
Fix: 205250672
Test: VtsHalVibratorTargetTest
Signed-off-by: chasewu <chasewu@google.com>
Change-Id: I908ab93eaee17de2af163c0fe3c50feea567ee48
Merged-In: I908ab93eaee17de2af163c0fe3c50feea567ee48
2022-03-29 19:32:42 +08:00
chasewu
d1a57eaac5 Fix the default BandwidthAmplitudeMap contant
Fix: 225286612
Test: atest VtsHalVibratorTargetTest
Signed-off-by: chasewu <chasewu@google.com>
Change-Id: I5c550426b7cbbdf6e4e9ad90d6248b6ed0523399
Merged-In: I5c550426b7cbbdf6e4e9ad90d6248b6ed0523399
2022-03-29 19:25:42 +08:00