fix(android-qa): wait for actual recording volume route

This commit is contained in:
NINI
2026-10-05 23:19:59 +09:00
parent 879cea84c4
commit dffd90b1b8
+6 -1
View File
@@ -119,10 +119,15 @@ function StartAudio([string]$Name,[int]$Seconds) {
Start-Sleep -Milliseconds 100 Start-Sleep -Milliseconds 100
} }
Check "audio-ready-$Name" $ready 'Recorder reported actual Recording started before interaction' Check "audio-ready-$Name" $ready 'Recorder reported actual Recording started before interaction'
for ($attempt=0; $attempt -lt 20; $attempt++) {
Adb @('shell','cmd','audio','set-volume','3','15') | Out-Null Adb @('shell','cmd','audio','set-volume','3','15') | Out-Null
$route=Adb @('shell','dumpsys','audio') $route=Adb @('shell','dumpsys','audio')
$route | Set-Content -LiteralPath (Join-Path $EvidenceDir "$Name-active-route.txt") -Encoding utf8 $route | Set-Content -LiteralPath (Join-Path $EvidenceDir "$Name-active-route-$attempt.txt") -Encoding utf8
$current=[regex]::Match($route,'(?s)- STREAM_MUSIC:.*?Current: ([^\r\n]+)').Groups[1].Value $current=[regex]::Match($route,'(?s)- STREAM_MUSIC:.*?Current: ([^\r\n]+)').Groups[1].Value
if ($current -match '8000 \(remote_submix\): 15') { break }
Start-Sleep -Milliseconds 250
}
$route | Set-Content -LiteralPath (Join-Path $EvidenceDir "$Name-active-route.txt") -Encoding utf8
Check "audio-active-route-$Name" ($current -match '8000 \(remote_submix\): 15') $current Check "audio-active-route-$Name" ($current -match '8000 \(remote_submix\): 15') $current
} }
function CompareAudio([string]$Name,[string[]]$Ids) { function CompareAudio([string]$Name,[string[]]$Ids) {