ObliviOS Developer portal Project site

Home / Decisions / ADR-182

DeviceSettingServiceConnection.getService in SettingsLib treats a SecurityException from Context.bindService as a failed bind.

Proposed, recorded 20 October 2026.

Decision
ADR-182
Date
2026-10-20
Status
ProposedProposed (landed and type-checked, not built, not run on a device; AIR-202).
Part
AirPods

1Decision

DeviceSettingServiceConnection.getService in SettingsLib treats a SecurityException from Context.bindService as a failed bind (patch 0002 of airpods/patches/frameworks-base), so a caller that may not bind a device settings provider gets no setting from it instead of an uncaught exception. The AirPods provider services stay exported="false" and keep their caller check (Callers.enforceSettings: system uid and own process only).

2Why and evidence

Owner report 2026-10-20 (stallion): with AirPods connected the volume slider's sound panel crashed SystemUI or hid the slider, and the sound settings button under the slider hung the phone until a reboot.

The path is [verified-in-source]: SystemUI's volume panel reads the setting DEVICE_SETTING_ID_ANC (1001) of the current audio device through the same SettingsLib repository as Settings, finds the AirPods provider through metadata key 25, and binds it as uid 10150 [measured on lynx: dumpsys package]; Settings is uid 1000.

ActivityManager answers "not exported from uid" (ActiveServices.retrieveServiceLocked), ContextImpl.bindServiceCommon throws SecurityException("Not allowed to bind to service"), and getService does not catch it. That the exception ends the SystemUI process, and that the panel then crashes again after a restart, is [assumption] until a logcat -b crash of stallion shows it.

Rejected: exporting the services with a permission and letting SystemUI call them (a new IPC endpoint on a privileged path, Callers.enforceSettings would have to admit SystemUI, and the toggle icons are blank bitmaps drawn only by Settings' own button); a catch inside SystemUI (a larger upstream divergence than one guard in the shared repository).

3Consequences

The volume panel shows no AirPods listening-mode button (it never had a designed one); Settings is unchanged because its bind succeeds. Every device whose provider cannot be bound by SystemUI is now harmless. One robolectric test was written and is not run.

4Review when

A stallion crash log shows another cause; the owner wants the listening mode in the volume panel (then the exported variant, with real icons and a reviewed caller check).

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