feat(aap): Also update system Bluetooth alias when renaming

After the AAP rename succeeds, try to update Android's per-device bond alias via the hidden BluetoothDevice.setAlias(String) method, so the new name also shows up in the system Bluetooth settings on this phone.

Known failure mode on Android 12+: setAlias is gated behind a Companion Device Manager (CDM) association at the service layer, and raises 'does not have a CDM association with the Bluetooth Device' for third-party apps that don't hold one. In that case, a dedicated snackbar explains that the system rename didn't go through and suggests renaming manually in system settings or re-pairing.

The AAP-level rename is always attempted first and is the load-bearing part; the system alias is a best-effort extra.
This commit is contained in:
darken
2026-04-08 15:36:18 +02:00
committed by Matthias Urhahn
parent 41245d928c
commit cb915d6263
4 changed files with 58 additions and 1 deletions
+1
View File
@@ -496,6 +496,7 @@
<string name="device_settings_rename_hint">Device name</string>
<string name="device_settings_rename_confirm">Rename</string>
<string name="device_settings_rename_invalid_ascii">Only ASCII characters are supported</string>
<string name="device_settings_rename_system_unavailable">Android didn\'t let us rename the device here. To update the name in Bluetooth settings, rename it there or re-pair the device.</string>
<string name="device_settings_send_failed">Could not apply setting: %1$s</string>
<string name="device_settings_category_connections_label">Connected Devices</string>
<string name="device_settings_connected_devices_description">Other devices currently connected to these AirPods</string>