Snap for 10580647 from 49c00e9afbab8eb81a840f8f75866354309010af to udc-d1-release

Change-Id: I513c2e81ceeaa3735e5580ab92708266f2ea0163
diff --git a/tests/cts/src/android/healthconnect/cts/TestUtils.java b/tests/cts/src/android/healthconnect/cts/TestUtils.java
index 8f3ec4c..c40e888 100644
--- a/tests/cts/src/android/healthconnect/cts/TestUtils.java
+++ b/tests/cts/src/android/healthconnect/cts/TestUtils.java
@@ -145,6 +145,7 @@
     public static final Instant SESSION_END_TIME =
             Instant.now().minus(10, ChronoUnit.DAYS).plus(1, ChronoUnit.HOURS);
     private static final String TAG = "HCTestUtils";
+    private static final int TIMEOUT_SECONDS = 5;
 
     public static boolean isHardwareAutomotive() {
         return hasSystemFeature(AUTOMOTIVE_FEATURE);
@@ -175,7 +176,7 @@
                         latch.countDown();
                     }
                 });
-        assertThat(latch.await(3, TimeUnit.SECONDS)).isTrue();
+        assertThat(latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS)).isTrue();
         if (exceptionAtomicReference.get() != null) {
             throw exceptionAtomicReference.get();
         }
@@ -215,7 +216,7 @@
                         latch.countDown();
                     }
                 });
-        assertThat(latch.await(3, TimeUnit.SECONDS)).isTrue();
+        assertThat(latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS)).isTrue();
         if (exceptionAtomicReference.get() != null) {
             throw exceptionAtomicReference.get();
         }
@@ -245,7 +246,7 @@
                         latch.countDown();
                     }
                 });
-        assertThat(latch.await(3, TimeUnit.SECONDS)).isTrue();
+        assertThat(latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS)).isTrue();
         if (exceptionAtomicReference.get() != null) {
             throw exceptionAtomicReference.get();
         }
@@ -277,7 +278,7 @@
                         latch.countDown();
                     }
                 });
-        assertThat(latch.await(3, TimeUnit.SECONDS)).isEqualTo(true);
+        assertThat(latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS)).isEqualTo(true);
         if (healthConnectExceptionAtomicReference.get() != null) {
             throw healthConnectExceptionAtomicReference.get();
         }
@@ -467,7 +468,7 @@
                         latch.countDown();
                     }
                 });
-        assertThat(latch.await(3, TimeUnit.SECONDS)).isTrue();
+        assertThat(latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS)).isTrue();
         if (healthConnectExceptionAtomicReference.get() != null) {
             throw healthConnectExceptionAtomicReference.get();
         }
@@ -505,7 +506,7 @@
                         latch.countDown();
                     }
                 });
-        assertThat(latch.await(3, TimeUnit.SECONDS)).isTrue();
+        assertThat(latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS)).isTrue();
         if (healthConnectExceptionAtomicReference.get() != null) {
             throw healthConnectExceptionAtomicReference.get();
         }
@@ -540,7 +541,7 @@
                         latch.countDown();
                     }
                 });
-        assertThat(latch.await(3, TimeUnit.SECONDS)).isTrue();
+        assertThat(latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS)).isTrue();
         if (healthConnectExceptionAtomicReference.get() != null) {
             throw healthConnectExceptionAtomicReference.get();
         }
@@ -575,7 +576,7 @@
                         latch.countDown();
                     }
                 });
-        assertThat(latch.await(3, TimeUnit.SECONDS)).isEqualTo(true);
+        assertThat(latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS)).isEqualTo(true);
         if (healthConnectExceptionAtomicReference.get() != null) {
             throw healthConnectExceptionAtomicReference.get();
         }
@@ -629,7 +630,7 @@
                         latch.countDown();
                     }
                 });
-        assertThat(latch.await(3, TimeUnit.SECONDS)).isEqualTo(true);
+        assertThat(latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS)).isEqualTo(true);
         if (healthConnectExceptionAtomicReference.get() != null) {
             throw healthConnectExceptionAtomicReference.get();
         }
@@ -661,7 +662,7 @@
                             latch.countDown();
                         }
                     });
-            assertThat(latch.await(3, TimeUnit.SECONDS)).isTrue();
+            assertThat(latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS)).isTrue();
             if (exceptionAtomicReference.get() != null) {
                 throw exceptionAtomicReference.get();
             }
@@ -696,7 +697,7 @@
                             latch.countDown();
                         }
                     });
-            assertThat(latch.await(3, TimeUnit.SECONDS)).isEqualTo(true);
+            assertThat(latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS)).isEqualTo(true);
             if (exceptionAtomicReference.get() != null) {
                 throw exceptionAtomicReference.get();
             }
@@ -728,7 +729,7 @@
                         latch.countDown();
                     }
                 });
-        assertThat(latch.await(3, TimeUnit.SECONDS)).isEqualTo(true);
+        assertThat(latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS)).isEqualTo(true);
         if (exceptionAtomicReference.get() != null) {
             throw exceptionAtomicReference.get();
         }
@@ -759,7 +760,7 @@
                         latch.countDown();
                     }
                 });
-        assertThat(latch.await(3, TimeUnit.SECONDS)).isEqualTo(true);
+        assertThat(latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS)).isEqualTo(true);
         if (exceptionAtomicReference.get() != null) {
             throw exceptionAtomicReference.get();
         }
@@ -804,7 +805,7 @@
                             latch.countDown();
                         }
                     });
-            assertThat(latch.await(3, TimeUnit.SECONDS)).isEqualTo(true);
+            assertThat(latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS)).isEqualTo(true);
             if (exceptionAtomicReference.get() != null) {
                 throw exceptionAtomicReference.get();
             }
@@ -844,7 +845,7 @@
                             latch.countDown();
                         }
                     });
-            assertThat(latch.await(3, TimeUnit.SECONDS)).isEqualTo(true);
+            assertThat(latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS)).isEqualTo(true);
             assertThat(responseException.get()).isNull();
             assertThat(response).isNotNull();
         } finally {
@@ -882,7 +883,7 @@
                         }
                     });
 
-            assertThat(latch.await(3, TimeUnit.SECONDS)).isEqualTo(true);
+            assertThat(latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS)).isEqualTo(true);
             if (exceptionAtomicReference.get() != null) {
                 throw exceptionAtomicReference.get();
             }
@@ -938,7 +939,7 @@
                         Log.e(TAG, exception.getMessage());
                     }
                 });
-        assertThat(latch.await(3, TimeUnit.SECONDS)).isTrue();
+        assertThat(latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS)).isTrue();
     }
 
     public static void finishMigration() throws InterruptedException {
@@ -961,7 +962,7 @@
                         Log.e(TAG, exception.getMessage());
                     }
                 });
-        assertThat(latch.await(3, TimeUnit.SECONDS)).isTrue();
+        assertThat(latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS)).isTrue();
     }
 
     public static void insertMinDataMigrationSdkExtensionVersion(int version)
@@ -989,7 +990,7 @@
                         latch.countDown();
                     }
                 });
-        assertThat(latch.await(3, TimeUnit.SECONDS)).isTrue();
+        assertThat(latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS)).isTrue();
         if (migrationExceptionAtomicReference.get() != null) {
             throw migrationExceptionAtomicReference.get();
         }
@@ -1029,7 +1030,7 @@
                         latch.countDown();
                     }
                 });
-        assertThat(latch.await(3, TimeUnit.SECONDS)).isEqualTo(true);
+        assertThat(latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS)).isEqualTo(true);
         if (responseException.get() != null) {
             throw responseException.get();
         }
@@ -1059,7 +1060,7 @@
                         latch.countDown();
                     }
                 });
-        assertThat(latch.await(3, TimeUnit.SECONDS)).isEqualTo(true);
+        assertThat(latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS)).isEqualTo(true);
         if (exceptionAtomicReference.get() != null) {
             throw exceptionAtomicReference.get();
         }