Repository navigation
perf(android): run settings permission all in one adb shell per batch - #5119
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
|
Thanks for the speedup, no code problems that need a change before merge were found at f351a5a, and the required evidence is in place. The two checks that did not pass are cancelled Five lower-priority inline threads still apply. Not verified here: the live timing and the base-versus-head result, Nothing blocks merge. |
Share one fake for batched and single pm calls in the permission tests, and name two tests after what they check.
Summary
settings permission grant|deny|reset allon Android spawned oneadb shell pmper declared permission, plus twopm clear-permission-flagsper applied one onreset. On an app declaring 55 permissions that took 1.4-2.1 s. The e2e runner sendsallbefore every fresh launch.Consecutive
pmids now run in oneadb shellscript, split into chunks under 3 KiB. Each command's exit code, stdout and stderr go through the same classification as before, and the script stops at the first refusal that is not skippable, so results, warnings, errors and the stop point are unchanged. Notifications and photos keep their paths and positions.The script calls
cmd packagedirectly when/system/bin/pmis that wrapper, and uses the builtinprint; this saved 329 ms on grant and 566 ms on reset.Host adb still passes no timeout, as before. On a remote provider a batch gets 30 s plus 500 ms per
pmcall, capped at 90 s.Before / after
Pixel 9 emulator, API 36, an app declaring 55 permissions, 5 runs each:
Timing, adb spawns and diffs
Validation
check:affected --run --head f351a5a9bandpnpm gate: format, lint, typecheck, layering, di-seams, fallow, native-dupes, native-dupes-model, mcp-metadata, build, package, vitest-related, provider-integration, integration-node, macos-coverage.