Modern Apps git

← Modern-Apps.git

camera: motion single dropdown; audio endpoints grouped right

Commit
3175e1fb8f2487b5b863d8d83af37d94fd208b74
Author
Vayun Mathur <[email protected]>
When
2026-11-24 16:38 UTC (11 days ago)
Parents
267690d
Motion Photo is now one dropdown (Off/1s/3s/5s) with a
persistence migration (legacy toggle=false -> Off,
toggle+length -> length, default stays on at 3s); the
motion/audio agent's remaining wiring.

Audio input: the API pairing was verified right
(AudioManager.getDevices(GET_DEVICES_INPUTS) enumerates
exactly what AudioRecord.setPreferredDevice accepts;
communication-device APIs are the wrong scope) - the
bug was grouping: ports of one physical device whose
address is present on only some ports split into
duplicate rows. Grouping now unions by shared
address/name within an endpoint family, selections
persist endpoint identity instead of runtime port ids,
no synthetic rows remain, and getRoutedDevice()
readback reports when a pick didn't stick.

Verified: compile green; targeted settings/audio/motion
tests green (16+2+8+6+14) in an isolated build dir.

Diff

camera/src/test/java/com/vayunmathur/camera/platform/camera2/AudioInputDevicesTest.kt
diff --git a/camera/src/test/java/com/vayunmathur/camera/platform/camera2/AudioInputDevicesTest.kt b/camera/src/test/java/com/vayunmathur/camera/platform/camera2/AudioInputDevicesTest.ktindex e8757ed6d1..29c102d2c5 100644--- a/camera/src/test/java/com/vayunmathur/camera/platform/camera2/AudioInputDevicesTest.kt+++ b/camera/src/test/java/com/vayunmathur/camera/platform/camera2/AudioInputDevicesTest.kt@@ -217,7 +217,8 @@ class AudioInputDevicesTest {         assertEquals(listOf<RawAudioInputDevice?>(usb), calls)         assertEquals(usb, result.device)         assertTrue(result.applied)-        assertEquals(AudioInputDeviceSelection(usb.id, usb.type, "USB Mic Pro"), result.selection)+        // This fake seam passes no endpoint identity, so none is resolved.+        assertEquals(AudioInputDeviceSelection(usb.id, usb.type), result.selection)     }      @Test fun noExplicitChoiceClearsThePreferredDevice() {