Reduce wait time for profiling trace file

This can reduce flakiness because if the timeout of
 sendCommandAndWaitReply(COMMAND_WAIT_FOR_PROFILE_OUTPUT)
is less than or equal to the timeout of closing file, the caller
will get TimeoutException.

It is fine to reduce the timeout for trace file because 3 seconds
are enough to write one line to file for verifying.

Bug: 192911553
Test: atest AmProfileTests
Change-Id: Id3cff55bc95f8bf0e8ed968e8212ba5c10799649
Merged-In: Id3cff55bc95f8bf0e8ed968e8212ba5c10799649
diff --git a/tests/framework/base/windowmanager/appProfileable/src/android/server/wm/profileable/ProfileableAppActivity.java b/tests/framework/base/windowmanager/appProfileable/src/android/server/wm/profileable/ProfileableAppActivity.java
index e7fa8ff..46f6183 100644
--- a/tests/framework/base/windowmanager/appProfileable/src/android/server/wm/profileable/ProfileableAppActivity.java
+++ b/tests/framework/base/windowmanager/appProfileable/src/android/server/wm/profileable/ProfileableAppActivity.java
@@ -61,7 +61,14 @@
 
     /** Monitor the close event of trace file. */
     private static class TraceFileObserver extends FileObserver {
-        private static final long TIMEOUT_MS = TimeUnit.SECONDS.toMillis(5);
+        /**
+         * The timeout for the close event of trace file. Although the trace file may take longer
+         * than 3 seconds, it is enough because the test only checks the first line of the file.
+         * Note that this timeout must be less than the value of
+         * {@link android.server.wm.CommandSession.ActivitySession.Response#TIMEOUT_MILLIS}.
+         * Otherwise the caller who sent {@link COMMAND_WAIT_FOR_PROFILE_OUTPUT} may get exception.
+         */
+        private static final long TIMEOUT_MS = TimeUnit.SECONDS.toMillis(3);
         private volatile boolean mDone;
 
         TraceFileObserver() {