@@ -399,7 +399,8 @@ jobs:
399399 Invoke-AndroidToolWithInput $sdkmanager "--install `"platform-tools`" `"emulator`" `"$windowsPlatform`" `"$windowsSystemImage`"" $yesFile
400400 Write-Host "Checking Android emulator acceleration"
401401 & $emulator -accel-check
402- if ($LASTEXITCODE -ne 0) {
402+ $accelSupported = $LASTEXITCODE -eq 0
403+ if (-not $accelSupported) {
403404 Write-Host "Hosted Windows runner did not report VM acceleration; forcing software acceleration for the CI smoke emulator."
404405 }
405406 Write-Host "Creating Android AVD"
@@ -416,10 +417,14 @@ jobs:
416417 "-gpu", "swiftshader_indirect",
417418 "-grpc", "8554",
418419 "-port", "5554",
419- "-accel", "off",
420420 "-no-metrics",
421421 "-skip-adb-auth"
422422 )
423+ if ($accelSupported) {
424+ $args += @("-accel", "on")
425+ } else {
426+ $args += @("-accel", "off")
427+ }
423428 function Write-EmulatorDiagnostics {
424429 Write-Host "adb devices:"
425430 & $adb devices -l
@@ -435,7 +440,7 @@ jobs:
435440 Write-Host "Starting Android emulator"
436441 $process = Start-Process -FilePath $emulator -ArgumentList $args -PassThru -RedirectStandardOutput $stdout -RedirectStandardError $stderr
437442 $process.Id | Out-File -FilePath emulator.pid -Encoding ascii
438- $deviceDeadline = (Get-Date).AddMinutes(8 )
443+ $deviceDeadline = (Get-Date).AddMinutes(10 )
439444 $deviceSeen = $false
440445 do {
441446 if ($process.HasExited) {
0 commit comments