refactor(android): remove Build.VERSION_CODES.O code checks#30
Merged
OS-ruimoreiramendes merged 2 commits intoJun 15, 2026
Conversation
jcesarmobile
approved these changes
Jun 15, 2026
jcesarmobile
left a comment
Member
There was a problem hiding this comment.
Looks good, but I don't think next branch is ready for working on capacitor 9, we should fix that before start merging new things
Contributor
Author
@jcesarmobile I'll create a separate ticket to prep next for Cap 9 (mirroring the pr ionic-team/capacitor-plugins#2523) and hold this PR until that's done. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Removes the
Build.VERSION_CODES.Ochecks inHaptics.java. They're no longer needed. Also removes the helper methods (vibratePre26,getOldSDKPattern) that only existed to feed those checks.Refs: RMET-5250
Change Type
Rationale / Problems Fixed
With the Capacitor 9 baseline bump,
minSdkVersionis now26. Everyif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)branch inHaptics.javais therefore always true, making theelsepaths and their helper methods (vibratePre26(int),vibratePre26(long[])) dead code. ThegetOldSDKPattern()API onHapticsVibrationTypeand its three implementations only existed to feed those dead paths, so it goes as well.Tests or Reproductions
./gradlew assembleDebuginandroid/: BUILD SUCCESSFUL./gradlew testDebugUnitTest: BUILD SUCCESSFULexample-appon a physical Android device and exercised every Haptics API exposed in the UI, all vibrations triggered as expected.Platforms Affected