Skip to content

Add legacy scan parameter on Android#260

Merged
fotiDim merged 4 commits into
mainfrom
fix/android-scan-legacy-default
Jun 23, 2026
Merged

Add legacy scan parameter on Android#260
fotiDim merged 4 commits into
mainfrom
fix/android-scan-legacy-default

Conversation

@fotiDim

@fotiDim fotiDim commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Android now has a legacy parameter for scan which can be set to true so that legacy BLE 4.x advertisements can be discovered.

@navidecklabs navidecklabs requested a review from Copilot June 22, 2026 08:32

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request removes the forced setLegacy(false) and setPhy configurations on Android SDK >= 26 to allow legacy BLE 4.x advertisements to be discovered by default, alongside updating the version to 2.0.5. The reviewer points out that removing setLegacy(false) entirely introduces a regression where BLE 5.0 extended advertisements can no longer be scanned. They suggest making this setting configurable via androidConfig to support both legacy and extended advertisements.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts Android BLE scanning behavior to once again include legacy BLE 4.x advertisements (commonly used by ESP32 devices) by no longer forcing Android’s scan settings into non-legacy/extended mode.

Changes:

  • Bump package version to 2.0.5.
  • Add a 2.0.5 changelog entry describing the Android scan behavior change.
  • Android: remove the API 26+ forced setLegacy(false) and setPhy(...) scan settings so Android uses its default (legacy) scan behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
pubspec.yaml Version bump to 2.0.5 to publish the behavior change.
CHANGELOG.md Documents the Android scan settings change in 2.0.5.
android/src/main/kotlin/com/navideck/universal_ble/UniversalBlePlugin.kt Stops forcing non-legacy/PHY scan settings so legacy BLE 4.x advertisements are returned again.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CHANGELOG.md Outdated
@navidecklabs navidecklabs requested a review from Copilot June 22, 2026 09:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 12 changed files in this pull request and generated 5 comments.

Comment thread README.md
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread pigeon/universal_ble.dart Outdated
Comment thread CHANGELOG.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 12 changed files in this pull request and generated 2 comments.

Comment thread README.md
@navidecklabs navidecklabs changed the title Listen for legacy BLE 4.x advertisements on Android Add legacy scan parameter on Android Jun 22, 2026
@fotiDim fotiDim requested a review from rohitsangwan01 June 22, 2026 15:54
@fotiDim fotiDim merged commit 671d218 into main Jun 23, 2026
2 checks passed
@fotiDim fotiDim deleted the fix/android-scan-legacy-default branch June 23, 2026 05:58
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.

3 participants