Skip to content

android: reconnect from the quick settings tile when AirPods are disconnected - #883

Open
GuangYiDing wants to merge 1 commit into
librepods-org:mainfrom
GuangYiDing:feat/qs-tile-reconnect
Open

GuangYiDing wants to merge 1 commit into
librepods-org:mainfrom
GuangYiDing:feat/qs-tile-reconnect

Conversation

@GuangYiDing

Copy link
Copy Markdown

While the AirPods aren't connected, the quick settings tile is set to STATE_UNAVAILABLE, so SystemUI greys it out and taps never reach onClick() (which only logged "Tile clicked but AirPods not connected"). Getting the AirPods back meant opening the app and tapping "Tap to reconnect". That's a common step when the AirPods move between an Android device and an iPhone.

This keeps the tile usable while disconnected:

  • updateTile() uses STATE_INACTIVE when disconnected, with the device name as the label and the existing localized tap_to_reconnect / reconnecting strings as the subtitle, instead of the hard-coded "AirPods" / "Disconnected".
  • Tapping the tile while disconnected calls AirPodsService.reconnectFromSavedMac(), the same thing the in-app "Tap to reconnect" button does. Further taps are ignored for 6 s while it reconnects, and the state resets on AIRPODS_CONNECTED.
  • If the service isn't running, the tap opens the app instead of doing nothing.

Behaviour while connected (cycling listening modes) is unchanged. This doesn't overlap with #777, which only adds a manifest intent filter for long-press.

Testing

OPPO Pad Mini, ColorOS 17 / Android 17 (no root), AirPods Pro, fossDebug build:

  • With the AirPods connected to an iPhone, the tile showed the device name and could be tapped.
  • One tap on the tile: the tablet started connecting about a second later, and A2DP was connected within ~3 s, without toggling Bluetooth.
  • Once connected, the tile switched back to the listening-mode tile.

ColorOS's compact tiles only show the label, so the "Tap to reconnect" subtitle is visible only where SystemUI shows tile subtitles.

🤖 Generated with Claude Code

…onnected

The tile used to be STATE_UNAVAILABLE while disconnected, so it could not
be tapped. Keep it clickable and call reconnectFromSavedMac() on tap, the
same action as the "Tap to reconnect" button in the app. Show
"Reconnecting" while a reconnect is in progress, and open the app if the
service is not running.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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