From 8e0ba13df51d27f1a0799d99f298a22f7d6f9eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Laban?= Date: Sat, 7 Dec 2024 20:43:12 -0500 Subject: [PATCH 1/3] fix: Adjust android wait script - Don't assume the order of ANR process reporting - Terminate the system UI preemptively in order to restart clean after boot --- .../android-uitest-wait-systemui.sh | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/build/test-scripts/android-uitest-wait-systemui.sh b/build/test-scripts/android-uitest-wait-systemui.sh index 8cc5e995dc01..681edfeb6971 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 +adb shell am force-stop com.android.systemui + +# disable system animations +adb shell settings put global animator_duration_scale 0 +adb shell settings put global transition_animation_scale 0 +adb shell settings put global window_animation_scale 0 + echo "Launcher is ready!" + From 08097aa249ffe99eda441ef5511126a49f8d2330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Laban?= Date: Sat, 7 Dec 2024 21:34:55 -0500 Subject: [PATCH 2/3] chore: Adjust paths --- build/test-scripts/android-uitest-wait-systemui.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/test-scripts/android-uitest-wait-systemui.sh b/build/test-scripts/android-uitest-wait-systemui.sh index 681edfeb6971..599f82d197bc 100755 --- a/build/test-scripts/android-uitest-wait-systemui.sh +++ b/build/test-scripts/android-uitest-wait-systemui.sh @@ -92,12 +92,12 @@ while [[ -z ${LAUNCHER_READY} ]]; do done # Force terminate system UI to restart clean -adb shell am force-stop com.android.systemui +"$ANDROID_HOME/platform-tools/adb" shell am force-stop com.android.systemui # disable system animations -adb shell settings put global animator_duration_scale 0 -adb shell settings put global transition_animation_scale 0 -adb shell settings put global window_animation_scale 0 +"$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!" From 37b8b86eb3e6d7313a63d37ecd88a29db813dd3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Laban?= Date: Mon, 9 Dec 2024 08:50:19 -0500 Subject: [PATCH 3/3] chore: REMOVEME validate for missing status bar --- build/test-scripts/android-uitest-wait-systemui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/test-scripts/android-uitest-wait-systemui.sh b/build/test-scripts/android-uitest-wait-systemui.sh index 599f82d197bc..8acd52f4079d 100755 --- a/build/test-scripts/android-uitest-wait-systemui.sh +++ b/build/test-scripts/android-uitest-wait-systemui.sh @@ -92,7 +92,7 @@ while [[ -z ${LAUNCHER_READY} ]]; do done # Force terminate system UI to restart clean -"$ANDROID_HOME/platform-tools/adb" shell am force-stop com.android.systemui +# "$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