Skip to content

refactor(android): remove Build.VERSION_CODES.O code checks#30

Merged
OS-ruimoreiramendes merged 2 commits into
nextfrom
chore/RMET-5250/remove-version-codes-o
Jun 15, 2026
Merged

refactor(android): remove Build.VERSION_CODES.O code checks#30
OS-ruimoreiramendes merged 2 commits into
nextfrom
chore/RMET-5250/remove-version-codes-o

Conversation

@OS-ruimoreiramendes

@OS-ruimoreiramendes OS-ruimoreiramendes commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Description

Removes the Build.VERSION_CODES.O checks in Haptics.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

  • Fix
  • Feature
  • Refactor
  • Breaking Change
  • Documentation
  • Other (CI, chores, etc.)

Rationale / Problems Fixed

With the Capacitor 9 baseline bump, minSdkVersion is now 26. Every if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) branch in Haptics.java is therefore always true, making the else paths and their helper methods (vibratePre26(int), vibratePre26(long[])) dead code. The getOldSDKPattern() API on HapticsVibrationType and its three implementations only existed to feed those dead paths, so it goes as well.

Tests or Reproductions

  • ./gradlew assembleDebug in android/: BUILD SUCCESSFUL
  • ./gradlew testDebugUnitTest: BUILD SUCCESSFUL
  • Ran the example-app on a physical Android device and exercised every Haptics API exposed in the UI, all vibrations triggered as expected.

Platforms Affected

  • Android
  • iOS
  • Web

@jcesarmobile jcesarmobile left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

@OS-ruimoreiramendes

OS-ruimoreiramendes commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

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

@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.

@OS-ruimoreiramendes OS-ruimoreiramendes merged commit 0c226be into next Jun 15, 2026
8 checks passed
@OS-ruimoreiramendes OS-ruimoreiramendes deleted the chore/RMET-5250/remove-version-codes-o branch June 15, 2026 16:41
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