RootCanal: Add HciRefreshEncryptionKey

Bug: 137138879
Test: run run_device_cert.sh
Change-Id: I5c7407f2e916dd96ab983c17d4adb0e0e59fdf44
diff --git a/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.cc b/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.cc
index db6b663..95392a1 100644
--- a/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.cc
+++ b/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.cc
@@ -178,6 +178,7 @@
   SET_HANDLER(OpCode::WRITE_LOCAL_NAME, HciWriteLocalName);
   SET_HANDLER(OpCode::READ_LOCAL_NAME, HciReadLocalName);
   SET_HANDLER(OpCode::WRITE_EXTENDED_INQUIRY_RESPONSE, HciWriteExtendedInquiryResponse);
+  SET_HANDLER(OpCode::REFRESH_ENCRYPTION_KEY, HciRefreshEncryptionKey);
   SET_HANDLER(OpCode::WRITE_VOICE_SETTING, HciWriteVoiceSetting);
   SET_HANDLER(OpCode::WRITE_CURRENT_IAC_LAP, HciWriteCurrentIacLap);
   SET_HANDLER(OpCode::WRITE_INQUIRY_SCAN_ACTIVITY, HciWriteInquiryScanActivity);
@@ -653,6 +654,20 @@
   SendCommandCompleteSuccess(OpCode::WRITE_EXTENDED_INQUIRY_RESPONSE);
 }
 
+void DualModeController::HciRefreshEncryptionKey(
+    packets::PacketView<true> args) {
+  CHECK(args.size() == 2) << __func__ << " size=" << args.size();
+  auto args_itr = args.begin();
+  uint16_t handle = args_itr.extract<uint16_t>();
+  SendCommandStatusSuccess(OpCode::REFRESH_ENCRYPTION_KEY);
+  // TODO: Support this in the link layer
+  hci::Status status = hci::Status::SUCCESS;
+  send_event_(
+      packets::EventPacketBuilder::CreateEncryptionKeyRefreshCompleteEvent(
+          status, handle)
+          ->ToVector());
+}
+
 void DualModeController::HciWriteVoiceSetting(packets::PacketView<true> args) {
   CHECK(args.size() == 2) << __func__ << " size=" << args.size();
   SendCommandCompleteSuccess(OpCode::WRITE_VOICE_SETTING);