Skip to content

Conversation

@hajimehoshi
Copy link
Owner

What issue is this addressing?

#3300

What type of issue is this addressing?

bug

What this PR does | solves

Calling vibrate without specifying the usage didn't work when the global setting 'touch feedback' is 0. As the application's vibration has nothing to do with touch feedbacks, this is an unexpected behavior.

Specify AudioAttributes or VibrationAttributes expcliitly.

…ck was muted

Calling `vibrate` without specifying the usage didn't work when the
global setting 'touch feedback' is 0. As the application's vibration
has nothing to do with touch feedbacks, this is an unexpected behavior.

Specify AudioAttributes or VibrationAttributes expcliitly.

Closes #3300
@hajimehoshi hajimehoshi requested a review from Copilot August 14, 2025 08:14
Copy link

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 bug where vibration functionality didn't work when the Android system's global "touch feedback" setting was disabled. The fix ensures that application vibrations work independently of this system setting by explicitly specifying VibrationAttributes or AudioAttributes with appropriate usage values.

  • Adds explicit VibrationAttributes (API 33+) and AudioAttributes (API 26-32) with media/game usage to bypass touch feedback restrictions
  • Updates vibrator service acquisition to use VibratorManager for API 31+ for better compatibility
  • Improves resource management with proper cleanup of JNI local references

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@hajimehoshi hajimehoshi deleted the issue-3300-android branch August 14, 2025 08:21
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