UserLifecycleTests: use test-timeout

Set a longer test timeout for use on slow devices. Use the
AndroidTest.xml test-timeout parameter for this.

Bug: 169449457
Bug: 198013452
Test: atest UserLifecycleTest
Change-Id: I9c66611e65dd07f500ee1b1ba9332fdd9b24a420
diff --git a/apct-tests/perftests/multiuser/AndroidTest.xml b/apct-tests/perftests/multiuser/AndroidTest.xml
index bec3cc9..a93d7e0 100644
--- a/apct-tests/perftests/multiuser/AndroidTest.xml
+++ b/apct-tests/perftests/multiuser/AndroidTest.xml
@@ -44,6 +44,9 @@
         <option name="package" value="com.android.perftests.multiuser" />
         <option name="hidden-api-checks" value="false"/>
 
+        <!-- Timeout individual tests only after 25m (rather than 10m default) for slow devices. -->
+        <option name="test-timeout" value="1500000" />
+
         <!-- Listener related args for collecting the traces and waiting for the device to stabilize. -->
         <option name="device-listeners" value="android.device.collectors.ProcLoadListener,android.device.collectors.PerfettoListener" />
         <!-- Guarantee that user defined RunListeners will be running before any of the default listeners defined in this runner. -->
diff --git a/apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java b/apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java
index 6e2742c..b6f2152 100644
--- a/apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java
+++ b/apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java
@@ -89,8 +89,8 @@
     private static final String TAG = UserLifecycleTests.class.getSimpleName();
 
     /** Max runtime for each test (including all runs within that test). */
-    // No point exceeding 10 minutes, since device would likely be considered non-responsive anyway.
-    private static final long TIMEOUT_MAX_TEST_TIME_MS = 9 * 60_000;
+    // Must be less than the AndroidTest.xml test-timeout to avoid being considered non-responsive.
+    private static final long TIMEOUT_MAX_TEST_TIME_MS = 24 * 60_000;
 
     private static final int TIMEOUT_IN_SECOND = 30;
     private static final int CHECK_USER_REMOVED_INTERVAL_MS = 200;