diff --git a/build/test-scripts/android-uitest-wait-systemui.sh b/build/test-scripts/android-uitest-wait-systemui.sh index 8cc5e995dc01..8acd52f4079d 100755 --- a/build/test-scripts/android-uitest-wait-systemui.sh +++ b/build/test-scripts/android-uitest-wait-systemui.sh @@ -67,6 +67,11 @@ 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 ;; @@ -74,12 +79,6 @@ while [[ -z ${LAUNCHER_READY} ]]; do 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 @@ -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!" +