Rust vibrator HAL: module test build (dodge / OnePlus 13) What changed - vendor.qti.hardware.vibrator.service.oplus_sm8750 rewritten in Rust (same name, rc, VINTF fragment and SELinux label). Open loop (PMIC input force feedback) and closed loop (audio DSP via PAL, used for on() > 3 s per HapticsPolicy.xml) are both ported. - One timer thread and one compose thread replace a detached sleeping thread per vibration. - Fixed from the C++: compose wait timeout never fired; getters reset the selected vibrator (so off() could miss a closed loop vibration); a pal_device leak on every closed loop play; uninitialised PAL payloads; amplitude written without the device lock. - libqtivibratoreffect.oplus.dodge.so: same effect tables, get_effect_stream now has C linkage. The installed C++ service cannot use this lib, so the scripts swap both together. - Not ported: Slate/AON pattern offload (phones do not have it) and closed loop compose. The policy routes compose to open loop on dodge, as before. Sources (server1 ~/penguin-dodge, local commits, not pushed; any ROM built from this tree now includes this HAL) - device/oneplus/sm8750-common 2a83583 "sm8750-common: vibrator: Rewrite the HAL in Rust" - device/oneplus/dodge e623e20 "dodge: vibrator: Export get_effect_stream with C linkage" - Base: sm8750-common 9f35ea9, dodge as of 2026-11-18 (g627 tree) ARB: not applicable. This is not a flashable zip; nothing touches firmware, boot or partitions. The test only bind-mounts two files over /vendor until reboot. How to test (root needed, e.g. KernelSU or adb root) Not tested on a device yet. The closed loop path (on() longer than 3 s) was never seen playing under the C++ HAL either, so it is the least proven part. 1. Copy this folder to the phone, e.g. /data/local/tmp/vib-rust 2. su -c sh /data/local/tmp/vib-rust/test-vib-rust.sh It prints threads and memory of the old and new service and saves a report. If the new service does not start it puts the installed one back by itself. 3. Try: - fast typing on the keyboard (many short effects in a row) - notification and ringtone vibration, and dismissing a ringing call mid vibration - long press, fingerprint unlock, scrolling ticks - from a root shell: cmd vibrator_manager synced oneshot 200 cmd vibrator_manager synced oneshot 5000 (closed loop path) cmd vibrator_manager synced prebaked 0 (CLICK) cmd vibrator_manager cancel (run during the 5000 ms one) cmd vibrator_manager help (composition syntax for this build) 4. su -c sh /data/local/tmp/vib-rust/check-vib-rust.sh and send me the output and report. 5. Device unit tests (optional): cp vendor.qti.hardware.vibrator.service.oplus_sm8750-test /data/local/tmp/ && chmod 755 /data/local/tmp/vendor.qti.hardware.vibrator.service.oplus_sm8750-test && /data/local/tmp/vendor.qti.hardware.vibrator.service.oplus_sm8750-test Rollback - Reboot (the bind mounts vanish), or: su -c sh revert-vib-rust.sh - Last known-good ROM stays published: https://unicorn.serverhive.in/saikiran/dodge/1811/g627/ Update 2026-11-18 14:30 IST (Yoga Claude): sm8750-common ab4097f, device-tested on OP13 - on() over 3 s now plays: the closed loop (PAL) refuses to start on this phone (-5), so the HAL falls back to open loop instead of dropping the vibration (old C++ dropped it too). - A failed start no longer stops a stream that never started. on(<=0) is rejected. - test-vib-rust.sh stages on /mnt/penguin_vib (the /dev copy could not start the HAL). Service sha256 is now 6e68af2f73e7c1f7aecb06f3f4f59d7fec41b9dad37109cf20145f00343a2cb9.