Skip to content

Fix Xiaomi haptic feedback crash#374

Merged
rosuH merged 1 commit into
masterfrom
codex/easywatermark-issue40-vibrate
May 17, 2026
Merged

Fix Xiaomi haptic feedback crash#374
rosuH merged 1 commit into
masterfrom
codex/easywatermark-issue40-vibrate

Conversation

@rosuH
Copy link
Copy Markdown
Owner

@rosuH rosuH commented May 17, 2026

Summary

  • Add android.permission.VIBRATE so Xiaomi/Android 16 haptic feedback paths can reach the vibrator service safely.
  • Guard View.performHapticFeedback against SecurityException and make the existing haptic cooldown effective.
  • Add a regression test for denied haptic permission handling.

Release note

  • Fixed a Xiaomi/Android 16 haptic feedback crash reported by A**** K***.

Test plan

  • ./gradlew :app:testDebugUnitTest :app:assembleRelease

Add the VIBRATE permission and guard View.performHapticFeedback so Xiaomi/Android 16 devices do not crash when haptic feedback reaches the vibrator service without permission.

Reported by A**** K***.
Copilot AI review requested due to automatic review settings May 17, 2026 01:49
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a haptic feedback crash path by declaring vibration permission and safely handling denied haptic feedback calls while preserving cooldown behavior.

Changes:

  • Adds android.permission.VIBRATE to the app manifest.
  • Wraps haptic feedback execution in a SecurityException guard.
  • Adds unit coverage for denied permission and delegate return behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
app/src/main/AndroidManifest.xml Declares vibration permission required by haptic feedback paths.
app/src/main/java/me/rosuh/easywatermark/utils/VibrateHelper.kt Adds safe haptic feedback execution and makes cooldown timestamp updates effective.
app/src/test/java/me/rosuh/easywatermark/utils/VibrateHelperTest.kt Adds regression tests for the safe haptic feedback helper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rosuH rosuH merged commit 8605861 into master May 17, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants