Merge "KeyMint VTS: x25519 pubkey as SubjectPublicKeyInfo" into tm-dev
diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp
index 7b3de58..b64c1a6 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp
@@ -995,11 +995,15 @@
 template <class CallbackType, class RequestType>
 FakeVehicleHardware::PendingRequestHandler<CallbackType, RequestType>::PendingRequestHandler(
         FakeVehicleHardware* hardware)
-    : mHardware(hardware), mThread([this] {
-          while (mRequests.waitForItems()) {
-              handleRequestsOnce();
-          }
-      }) {}
+    : mHardware(hardware) {
+    // Don't initialize mThread in initialization list because mThread depends on mRequests and we
+    // want mRequests to be initialized first.
+    mThread = std::thread([this] {
+        while (mRequests.waitForItems()) {
+            handleRequestsOnce();
+        }
+    });
+}
 
 template <class CallbackType, class RequestType>
 void FakeVehicleHardware::PendingRequestHandler<CallbackType, RequestType>::addRequest(