Bass: Broadcast resync helper
Helps sinks to resync to external broadcast when BIS or PA unsynced. Defined 3 types of broadcast pause when synchronization is stopped: - HOST_INTENTIONAL for phone action - SINK_UNKNOWN for unidentified action - SINK_INTENTIONAL for buds action - SINK_UNINTENTIONAL for source action Main logic to distinguish between intentional and unintentional sink pause: 1. Buds notifies about BIS unsync. BASS set SINK_UNKNOWN pause type. It syncs to the broadcast and starts 6 seconds timer for MESSAGE_BIG_CHECK_START. 2. MESSAGE_BIG_CHECK_START clears BigInfoReportExist variable and starts 2 seconds timer for MESSAGE_BIG_CHECK_STOP 3. MESSAGE_BIG_CHECK_STOP checks if there is any BigInfoReportExist, if so then changes pause type to SINK_INTENTIONAL. Otherwise, it changes pause type to SINK_UNINTENTIONAL and caches sources for future resume. It starts 5 minutes MESSAGE_SYNC_TIMEOUT to monitor BIG appearing. Even if pause is SINK_INTENTIONAL it keeps sync by 5 minutes in case that buds send SyncInfo Request. 4. If BigInfoReport appears and pause was SINK_UNINTENTIONAL, reciever sources synchronization is resumed. 5. On: MESSAGE_SYNC_TIMEOUT, sync established failed, sync lost, HOST_INTENTIONAL action or buds automatic resynchronization, whole procedure is stopped. Extras: - Above logic works even on first connection with broadcast, so if there is no BIG, BASS will monitor it for 5 minutes and sync automatically. - Sync to the broadcasts already synced with sinks on searching start, that improves time of showing it on the list. Bug: 355218881 Bug: 363168099 Test: atest BassClientServiceTest Change-Id: I91cf99fbec73f57a259fa0bab2e555bd82912976
Loading
Please register or sign in to comment