Skip to content

fix(lint): dead SDK checks, intersect result, service leak, explicit locale - #835

Merged
LeanBitLab merged 2 commits into
mainfrom
fix/lint-code-issues
Nov 15, 2026
Merged

LeanBitLab merged 2 commits into
mainfrom
fix/lint-code-issues

Conversation

@LeanBitLab

Copy link
Copy Markdown
Owner

Summary

  • Remove 17 SDK_INT checks that are always true with minSdk 23 (and their dead else branches).
  • `Rect.intersect` leaves the rect unclipped when there is no overlap: empty it in `FloatingKeyboardManager` and the touchable region in `LatinIME`, so a view fully outside the window no longer counts as visible.
  • `AccessibilityUtils` is a static singleton and kept the `LatinIME` service as its context; keep the application context instead.
  • `@SuppressLint("StaticFieldLeak")` on four singletons that already hold the application context (false positives).
  • `CustomSoundManager`: `TYPE_BLE_BROADCAST` needs API 33, not 31.
  • Make the default locale explicit in three `String.format` calls (no behavior change).

Not included (separate follow-ups): `ClickableViewAccessibility`, stale translations, unused resources.

Verification

  • `./gradlew :app:assembleStandardDebug` and `compileOfflineRunTestsKotlin` pass
  • `lintStandardDebug`: 0 errors, ObsoleteSdkInt/StaticFieldLeak/DefaultLocale/CheckResult now 0
  • Not run on a device: floating keyboard touch region, spoken feedback via TalkBack, voice recording start

Behavior is unchanged, numbers are still formatted for the device locale.
…atic service reference

- drop SDK_INT checks that are always true with minSdk 23
- Rect.intersect leaves the rect unclipped when there is no overlap, so empty it
  (FloatingKeyboardManager, LatinIME touchable region)
- AccessibilityUtils is a static singleton and held the LatinIME service, keep the
  application context instead
- suppress StaticFieldLeak where the singleton already holds the application context
- CustomSoundManager: BLE broadcast devices need API 33, not 31
@LeanBitLab
LeanBitLab merged commit 3d4e6b8 into main Nov 15, 2026
1 check passed
@LeanBitLab
LeanBitLab deleted the fix/lint-code-issues branch November 15, 2026 16:16
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.

1 participant