Before a now-playing display, find where the head unit tells what is playing, read only: the players Android reports, the active media sessions, and every media browser service with its song, CarPlay's (com.allgo.remoteui.mediabrowserservice) among them. The report is saved and sent like a signal recording (shared SignalRecorder.saveCopies). Also the findings of the first two recordings from the server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LhzAVaUyqcw5PkGjz4mWW6
39 lines
1.4 KiB
Java
39 lines
1.4 KiB
Java
package com.evsuite.abrp;
|
|
|
|
import static org.junit.Assert.assertEquals;
|
|
import static org.junit.Assert.assertTrue;
|
|
|
|
import org.junit.Test;
|
|
|
|
public class MediaProbeTextTest {
|
|
|
|
@Test
|
|
public void anotherAppsTextStaysOnOneLine() {
|
|
assertEquals("Song Title", MediaProbeText.clean("Song\nTitle"));
|
|
assertEquals("(none)", MediaProbeText.clean(null));
|
|
assertEquals("(empty)", MediaProbeText.clean(" \t"));
|
|
String longText = new String(new char[500]).replace('\0', 'a');
|
|
String cleaned = MediaProbeText.clean(longText);
|
|
assertEquals(MediaProbeText.MAX_TEXT + 1, cleaned.length());
|
|
assertTrue(cleaned.endsWith("…"));
|
|
}
|
|
|
|
@Test
|
|
public void androidsNumbersHaveNames() {
|
|
assertEquals("playing", MediaProbeText.playbackState(3));
|
|
assertEquals("paused", MediaProbeText.playbackState(2));
|
|
assertEquals("state 99", MediaProbeText.playbackState(99));
|
|
assertEquals("media", MediaProbeText.usage(1));
|
|
assertEquals("navigation guidance", MediaProbeText.usage(12));
|
|
assertEquals("assistant", MediaProbeText.usage(16));
|
|
assertEquals("started", MediaProbeText.playerState(2));
|
|
}
|
|
|
|
@Test
|
|
public void durationsAsMinutes() {
|
|
assertEquals("3:25", MediaProbeText.duration(205_400));
|
|
assertEquals("0:00", MediaProbeText.duration(0));
|
|
assertEquals("?", MediaProbeText.duration(-1));
|
|
}
|
|
}
|