Conversation
fetchUuidsWithSdp() on all bonded devices pages each one; absent devices take ~5 s to page-timeout, so the queue ran for about a minute after every service start. When it reached the AirPods it pulled them off the iPad, and it delayed other apps' queued SDP requests (e.g. Sony Headphones Connect) until after the iPad had taken over, causing another steal. Changes: - AirPodsService.onCreate: stop calling fetchUuidsWithSdp() for every bonded device; identify the AirPods from cached UUIDs only. - The ACL_CONNECTED path still fetches UUIDs when a device actually connects without the AAP UUID cached. Tested: Pixel 6a, Android 17 (API 37), unrooted, AirPods 4 (ANC); verified in logcat. Before: 8 SDP requests queued per service start; after: none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vishu1038
force-pushed
the
fix/startup-sdp-burst
branch
from
September 26, 2026 13:46
34d4653 to
baf44c6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On service start,
AirPodsServicecallsfetchUuidsWithSdp()on every bonded device. Each device that isn't nearby takes about 5 s to page-timeout, so the SDP queue stays busy for about a minute after every start. (With 8 bonded devices, 8 fetches are queued.)Fix
Use the cached
device.uuidsat startup and drop the blanketfetchUuidsWithSdp(). TheACL_CONNECTEDpath still fetches UUIDs when the AirPods actually connect and the cache is empty.Evidence
Before: 8
fetchRemoteUuidsWithSdpfrom LibrePods' uid right after install/restart, andbta_dm_discover_services … 62:ccrepeating for about 50 s. After: 0 in the first 15 s.Tested on a Pixel 6a running Android 17 (API 37, unrooted, FOSS debug build) with AirPods 4 (ANC). Not tested on other devices or AirPods models.
These changes were written with AI assistance (Claude Code) and debugged against logcat captures from the device above.
🤖 Generated with Claude Code