ObliviOS Developer portal Project site

Home / Decisions / ADR-122

AirPodsApp serves Settings' own Bluetooth device page through the DeviceSettings contract.

Accepted, recorded 1 October 2026.

Decision
ADR-122
Date
2026-10-01
Status
AcceptedAccepted (compiled and seen on a device with a debug state; no real session)
Part
AirPods
Mentions
ADR-123
Mentioned by
ADR-124

1Decision

AirPodsApp serves Settings' own Bluetooth device page through the DeviceSettings contract: the contract classes are vendored into the app (40 files, byte-identical to the build tree, guarded by airpods/tools/check-devicesettings-vendoring.sh); the config service and the device-settings service are exported="false" and additionally check that the caller is the system uid or ourselves; the ring icons come from a read-only, unexported provider with a fixed allow-list and a persistable grant to com.android.settings; metadata is written only through BluetoothDevice#setAirPodsMetadata in the order icons, untethered flag, battery and charging, key 25 last, and the first set-up is repeated until it succeeds; a debuggable build (Build.TYPE not user) can be fed a state through the global setting airpods_debug_state and has no component or endpoint for it; Settings' own action buttons (Forget, Disconnect) stay on the page.

2Why and evidence

SettingsLib is a platform-API module and Soong refuses it as a static dependency of a system_current app, so vendoring is the only route without a platform signature. Settings runs as the system uid and may bind unexported components (ActivityManager.checkComponentPermission), confirmed on the device (Service connected for both services). A debug entry inside the production app would ship an extra endpoint; a setting read only when Build.TYPE is not user adds none. Hiding the action buttons would remove the only unpair path. Build.IS_DEBUGGABLE is @hide and not in the stubs, so Build.TYPE is used.

3Consequences

The app holds only BLUETOOTH_CONNECT and MANAGE_AIRPODS_IDENTITY; its one exported component is a receiver for the protected broadcasts ACL_CONNECTED and BOND_STATE_CHANGED (the Bluetooth process sends them as its own uid), which also starts the process and repeats pending metadata writes. A rebuilt system app cannot be installed with adb install on this build (fs-verity), so every app change needs a new image.

A cached app is frozen by the system and does not run its observer; the real session (Plan 6D) must be a foreground service. The runtime grant of BLUETOOTH_CONNECT is still done by hand (pm grant) and is an owner decision for production. Not proven: the real session, dark theme and larger font scales, the 8 dp button padding on a device, the cause of a split-second flash of Settings' stock earbud drawings (hypothesis in the validation matrix).

Update 2026-10-02: dark theme, font scales, the padding on a device and RTL are checked (AIR-116, AIR-118, AIR-119); the flash was not reproduced and the setSubDeviceType hypothesis was wrong (AIR-117); label wrapping is ADR-123.

4Review when

A rebase that changes the devicesettings directory, AdvancedBluetoothDetailsHeaderController, BluetoothDetailsConfigurableFragment or SegmentedButtonPreference; AIR-111 to AIR-115 regressing; any request for another exported component; the default-grant decision.

Read from docs/governance/decision-log.md, entry ADR-122.