Record the first complete benchmark run, and what its numbers are not
With the install watcher answering MIUI's dialog, all four tests ran and three produced numbers: coldStart 574.17 ms P50 (553.95-730.19), opening a 1000-file folder 14 frames P50 (13-17), scrolling it with four swipes 98 frames P50 (93-100). The search benchmark still fails, on the app bar's search action not being in the accessibility tree after twenty seconds - the setup wait is raised from ten to twenty now that the folder render is known to be the slow step. The frame counts are labelled as frame counts and not as jank, because this phone reports no frame durations at all: the same results file contains frameCount and nothing else, so 14 frames says the interaction is short and says nothing about whether a frame was slow. The doc also keeps the measurements that explain the watcher's shape - the dialog is FLAG_SECURE, its lifetime varies between under a second and 8.5 s, and pm install from an app uid fails earlier with MIUI's XSpace SecurityException - along with the honest cost: MIUI keeps mCurrentFocus on the installer after the window is gone, so a coordinate tap can land on the home screen, which it did. The watcher no longer reuses a saved position at all and refuses to tap within two seconds of the previous tap.
This commit is contained in:
@@ -58,17 +58,9 @@ device_dump=/sdcard/.benchmark-watch.xml
|
||||
local_dump=$(mktemp)
|
||||
trap 'rm -f "$local_dump"' EXIT
|
||||
|
||||
layout_file="${XDG_CACHE_HOME:-$HOME/.cache}/plain-files-benchmark-install-layout"
|
||||
layout_activity=""
|
||||
layout_x=""
|
||||
layout_y=""
|
||||
layout_label=""
|
||||
if [ -f "$layout_file" ]; then
|
||||
read -r layout_activity layout_x layout_y layout_label <"$layout_file" || true
|
||||
fi
|
||||
|
||||
answered_token=""
|
||||
tapped_token=""
|
||||
last_tap_at=-100
|
||||
opened_windows=0
|
||||
taps=0
|
||||
misses=0
|
||||
@@ -149,25 +141,6 @@ answer_dialog() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Fast path: the position of this dialog's Install button was measured earlier and saved, and reading
|
||||
# the screen again takes longer than the dialog lives. The saved position is used only while an
|
||||
# installer window is focused — checked again immediately before the tap, 0.1 s earlier — so it can
|
||||
# never land on whatever is behind a dialog that has closed.
|
||||
if [ -n "$layout_x" ] && [ "$layout_activity" = "$activity" ]; then
|
||||
now_focus=$(focused_window)
|
||||
if is_installer "$now_focus" && [ "$(installer_activity "$now_focus")" = "$activity" ]; then
|
||||
tapped_token=$(window_token "$now_focus")
|
||||
if [ "$dry_run" -eq 1 ]; then
|
||||
echo " $(date +%H:%M:%S) would tap '$layout_label' at $layout_x,$layout_y (measured position, installer focused)"
|
||||
else
|
||||
adb shell input tap "$layout_x" "$layout_y" || true
|
||||
taps=$((taps + 1))
|
||||
echo " $(date +%H:%M:%S) tapped '$layout_label' at $layout_x,$layout_y (measured position, installer focused)"
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
local attempt
|
||||
for attempt in $(seq 1 "$wait"); do
|
||||
read -r button_x button_y label <<<"$(install_button)"
|
||||
@@ -180,13 +153,12 @@ answer_dialog() {
|
||||
# Whatever installer dialog is up *now* is the one being answered; it may be a newer window
|
||||
# than the one this function was called for, which is exactly the case that used to be
|
||||
# skipped.
|
||||
if [ $((SECONDS - last_tap_at)) -lt 2 ]; then
|
||||
echo " $(date +%H:%M:%S) a tap went out less than 2 s ago; not tapping again"
|
||||
return 0
|
||||
fi
|
||||
tapped_token=$(window_token "$now_focus")
|
||||
# Remember where this button was, for the dialogs that cannot be read in time.
|
||||
layout_activity=$activity
|
||||
layout_x=$button_x
|
||||
layout_y=$button_y
|
||||
layout_label=$label
|
||||
printf '%s %s %s %s\n' "$activity" "$button_x" "$button_y" "$label" >"$layout_file" 2>/dev/null || true
|
||||
last_tap_at=$SECONDS
|
||||
if [ "$dry_run" -eq 1 ]; then
|
||||
echo " $(date +%H:%M:%S) would tap '$label' at $button_x,$button_y"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user