OSDN Git Service

RootCanal: Reset the model in BluetoothHci::close
authorMyles Watson <mylesgw@google.com>
Wed, 26 Aug 2020 14:30:00 +0000 (07:30 -0700)
committerMyles Watson <mylesgw@google.com>
Wed, 26 Aug 2020 16:18:09 +0000 (09:18 -0700)
Bug: 166326066
Tag: #stability
Test: com.android.devicehealthchecks
Change-Id: Ia75d07e34a38a74d2f09b6174a387089029e9318

test/rootcanal/bluetooth_hci.cc

index 255dbff..926408f 100644 (file)
@@ -164,8 +164,6 @@ Return<void> BluetoothHci::initialize_impl(
   controller_->RegisterTaskCancel(
       [this](AsyncTaskId task) { async_manager_.CancelAsyncTask(task); });
 
-  test_model_.Reset();
-
   // Add the controller as a device in the model.
   size_t controller_index = test_model_.Add(controller_);
   size_t low_energy_phy_index =
@@ -225,6 +223,7 @@ Return<void> BluetoothHci::initialize_impl(
 
 Return<void> BluetoothHci::close() {
   LOG_INFO("%s", __func__);
+  test_model_.Reset();
   return Void();
 }