From d23762799b889765fbf33ef43e2373551c90f687 Mon Sep 17 00:00:00 2001 From: Garfield Tan Date: Tue, 13 Apr 2021 12:00:52 -0700 Subject: libhwui: Use wc instead of du to monitor file write du returns the disk space a file occupies, which isn't guaranteed to be 0 even if the file is empty on all file systems. Use "wc -c" instead to obtain the file size. Bug: 184878226 Test: The script waits for the file to have content on file system that uses disk space to store empty files. Test: Skia capture still works for Pixel. Change-Id: Ib5f75b6712b476fc521a531fba029f91f4b281b5 --- libs/hwui/tests/scripts/skp-capture.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libs/hwui') diff --git a/libs/hwui/tests/scripts/skp-capture.sh b/libs/hwui/tests/scripts/skp-capture.sh index 4b46fbf86818..0749a8dcebcb 100755 --- a/libs/hwui/tests/scripts/skp-capture.sh +++ b/libs/hwui/tests/scripts/skp-capture.sh @@ -76,8 +76,8 @@ banner '...WAITING FOR APP INTERACTION...' # so we continue to show the "waiting for app interaction" message as long as the app still requires # interaction to draw more frames. adb_test_file_nonzero() { - # grab first byte of `du` output - X="$(adb shell "du \"$1\" 2> /dev/null | dd bs=1 count=1 2> /dev/null")" + # grab first byte of `wc -c` output + X="$(adb shell "wc -c \"$1\" 2> /dev/null | dd bs=1 count=1 2> /dev/null")" test "$X" && test "$X" -ne 0 } timeout=$(( $(date +%s) + $phase1_timeout_seconds)) -- cgit v1.2.3-59-g8ed1b