Increase timeout to allow for nested virtualization am: 4df9377bac

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Virtualization/+/1846333

Change-Id: Ib195161e27bdf477dc505ee0059c9027721e20fa
diff --git a/compos/common/compos_client.rs b/compos/common/compos_client.rs
index 5f14005..a69538e 100644
--- a/compos/common/compos_client.rs
+++ b/compos/common/compos_client.rs
@@ -223,9 +223,12 @@
     }
 
     fn wait_until_ready(&self) -> Result<i32> {
+        // 10s is long enough on real hardware, but it can take 90s when using nested
+        // virtualization.
+        // TODO(b/200924405): Reduce timeout/detect nested virtualization
         let (state, result) = self
             .state_ready
-            .wait_timeout_while(self.mutex.lock().unwrap(), Duration::from_secs(20), |state| {
+            .wait_timeout_while(self.mutex.lock().unwrap(), Duration::from_secs(120), |state| {
                 state.cid.is_none() && !state.has_died
             })
             .unwrap();
diff --git a/compos/compos_key_cmd/compos_key_cmd.cpp b/compos/compos_key_cmd/compos_key_cmd.cpp
index e168648..f495816 100644
--- a/compos/compos_key_cmd/compos_key_cmd.cpp
+++ b/compos/compos_key_cmd/compos_key_cmd.cpp
@@ -156,7 +156,10 @@
 
     bool waitUntilReady() {
         std::unique_lock lock(mMutex);
-        return mCv.wait_for(lock, std::chrono::seconds(20), [this] { return mReady || mDied; }) &&
+        // 10s is long enough on real hardware, but it can take 90s when using nested
+        // virtualization.
+        // TODO(b/200924405): Reduce timeout/detect nested virtualization
+        return mCv.wait_for(lock, std::chrono::seconds(120), [this] { return mReady || mDied; }) &&
                 !mDied;
     }