Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Adjust android wait script #19033

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions build/test-scripts/android-uitest-wait-systemui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,18 @@ while [[ -z ${LAUNCHER_READY} ]]; do
echo "(DEBUG $SECONDS) Current focus: ${UI_FOCUS}"

case $UI_FOCUS in
*"Not Responding"*)
echo "Detected an ANR! Dismissing..."
$ANDROID_HOME/platform-tools/adb shell input keyevent KEYCODE_DPAD_RIGHT
$ANDROID_HOME/platform-tools/adb shell input keyevent KEYCODE_ENTER
;;
*"Launcher"*)
LAUNCHER_READY=true
;;
"")
echo "Waiting for window service..."
sleep 3
;;
*"Not Responding"*)
echo "Detected an ANR! Dismissing..."
$ANDROID_HOME/platform-tools/adb shell input keyevent KEYCODE_DPAD_DOWN
$ANDROID_HOME/platform-tools/adb shell input keyevent KEYCODE_DPAD_DOWN
$ANDROID_HOME/platform-tools/adb shell input keyevent KEYCODE_ENTER
;;
*)
echo "Waiting for launcher..."
sleep 3
Expand All @@ -92,4 +91,13 @@ while [[ -z ${LAUNCHER_READY} ]]; do
esac
done

# Force terminate system UI to restart clean
"$ANDROID_HOME/platform-tools/adb" shell am force-stop com.android.systemui

# disable system animations
"$ANDROID_HOME/platform-tools/adb" shell settings put global animator_duration_scale 0
"$ANDROID_HOME/platform-tools/adb" shell settings put global transition_animation_scale 0
"$ANDROID_HOME/platform-tools/adb" shell settings put global window_animation_scale 0

echo "Launcher is ready!"

Loading