Skip to content

fix: EPT-6335: Fix USB permission broadcast dropped on Android 14+ and blocking permission wait - #21

Merged
hammadqayyum1534 merged 1 commit into
mainfrom
fix/EPT-6335
Sep 2, 2026
Merged

hammadqayyum1534 merged 1 commit into
mainfrom
fix/EPT-6335

Conversation

@hammadqayyum1534

@hammadqayyum1534 hammadqayyum1534 commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

EPT-6335

Summary

  • The USB permission PendingIntent wrapped an implicit intent, so on apps targeting Android 14+ (TSA is now targetSdk 36) the permission result broadcast was silently dropped — searchUsbDevices() then spun forever in its while/delay loop, hanging the search stream ("No stream event" timeouts in TSA) and blocking reconnection after any USB drop.
  • Fixed with Intent(...).setPackage(...) + FLAG_MUTABLE (system must attach result extras), and non-blocking permission handling: devices without permission trigger one request and are picked up by a later search poll once granted.

Note: this branch is based on ea4b6e5 (the revision TSA production resolves), not current main tip, because main's rxdart ^0.28.0 bump is incompatible with TSA's rxdart ^0.27.7. Merge may need a trivial rebase.

Companion PR: gogovan/flutter-iot#23 (same fix for the label printer searcher + scale disconnect fix).

Test plan

  • Package unit tests pass
  • Verified on Xiaomi Pad (Android 14+, TSA devDigitalscale): permission dialog appears, scale connects
  • Mid-session unplug/replug: reconnects without app force-close

🤖 Generated with Claude Code

…d remove blocking permission wait

The permission PendingIntent wrapped an implicit intent, so on apps
targeting API 34+ the permission result broadcast was silently dropped
and searchUsbDevices() spun forever in its delay loop, hanging the
search stream ("No stream event" timeouts) and blocking reconnection
after any USB drop. Make the intent explicit (setPackage) with
FLAG_MUTABLE, and make permission handling non-blocking: unpermitted
devices trigger a request and are picked up by a later search poll.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.68%. Comparing base (09f1a5c) to head (baa6664).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #21      +/-   ##
==========================================
+ Coverage   73.55%   73.68%   +0.12%     
==========================================
  Files          10       10              
  Lines         208      209       +1     
==========================================
+ Hits          153      154       +1     
  Misses         55       55              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hammadqayyum1534
hammadqayyum1534 merged commit 82f5988 into main Sep 2, 2026
1 check passed
@hammadqayyum1534
hammadqayyum1534 deleted the fix/EPT-6335 branch September 2, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants