Skip to content

Add LDAC playback quality tile - #42

Open
eggmasonvalue wants to merge 3 commits into
WSTxda:mainfrom
eggmasonvalue:feature/ldac-bitrate-v2
Open

eggmasonvalue wants to merge 3 commits into
WSTxda:mainfrom
eggmasonvalue:feature/ldac-bitrate-v2

Conversation

@eggmasonvalue

Copy link
Copy Markdown

Summary

Adds a Quick Settings tile that cycles the playback quality of the active LDAC A2DP device:

  • Best effort (adaptive)
  • Connection preferred (330 kbps)
  • Balanced (660 kbps)
  • Audio quality preferred (990 kbps)

This is a clean reimplementation on the current main branch and supersedes #14.

Behavior

  • Shows the current quality in both the subtitle and a distinct waveform icon.
  • Remains unavailable when no A2DP device is connected or LDAC is not the active codec.
  • Observes Bluetooth connection, codec, and global-setting changes.
  • Queues a tap while the asynchronous A2DP profile proxy initializes, so the first cold tap is not lost.
  • Writes the platform LDAC quality setting and applies the preference to the active LDAC device.
  • Preserves the device's existing sample rate, bit depth, channel mode, and codec-specific fields.

Permissions and compatibility

  • Supports API 26 and newer.
  • Requests BLUETOOTH_CONNECT at runtime on Android 12+.
  • Reuses the existing WRITE_SECURE_SETTINGS setup flow.
  • Requests a per-device Companion Device Manager association where required on Android 16+.
  • Uses resource booleans to gate the tile and association activity by SDK level, addressing the feedback on feat: LDAC bitrate QS tile #14.
  • Bluetooth calls are permission-guarded and lint-annotated.

Validation

  • :app:assembleDebug
  • :app:lintDebug
  • :app:assembleRelease (including R8)
  • Installed as an in-place upgrade over version 2.0.
  • Tested on a Pixel 10 with an active LDAC device.
  • Verified repeated cold-process first taps cycle the setting correctly.

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