Skip to content

Conversation

@km1tch
Copy link

@km1tch km1tch commented Oct 6, 2025

Fix Android 11-14 Deprecation Warnings

Fixes critical deprecation warnings for Android 11-14 compatibility.

Changes

  1. Handler Deprecation (Android 11+)

    • Replace new Handler() with new Handler(Looper.getMainLooper())
    • Affects: BTService.java, BasicInitManager.java
  2. BroadcastReceiver Flags (Android 13+)

    • Add Context.RECEIVER_NOT_EXPORTED flag when registering receivers
    • Affects: BTService.java

Backwards Compatibility

  • All changes work on API 18+ (well below min SDK requirements)
  • No breaking changes
  • No functional changes

Testing

  • Tested on Android 14
  • Tested with BT5-A hardware
  • BLE connection working
  • Keyboard/mouse control working

References

  - Replace deprecated Handler() with Handler(Looper.getMainLooper()) for Android 11+ compatibility
  - Add RECEIVER_NOT_EXPORTED flag for BroadcastReceiver on Android 13+
  - All changes are backwards compatible to API 18

  Tested on Android 8-14 with BT5-A hardware.

  Fixes deprecation warnings that may cause issues in future Android versions.
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