Migrate pin code handling out of btu_hcif

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I5db16b23cc42923f547e6b58793d76dc3fb5a2a0
diff --git a/system/stack/btm/btm_int.h b/system/stack/btm/btm_int.h
index ab50b00..d29053e 100644
--- a/system/stack/btm/btm_int.h
+++ b/system/stack/btm/btm_int.h
@@ -248,7 +248,7 @@
                                           const Octet16& link_key,
                                           uint8_t key_type);
 extern void btm_sec_link_key_request(const RawAddress& p_bda);
-extern void btm_sec_pin_code_request(const RawAddress& p_bda);
+extern void btm_sec_pin_code_request(uint8_t* p_event);
 extern void btm_sec_update_clock_offset(uint16_t handle, uint16_t clock_offset);
 extern void btm_sec_dev_rec_cback_event(tBTM_SEC_DEV_REC* p_dev_rec,
                                         uint8_t res, bool is_le_trasnport);
diff --git a/system/stack/btm/btm_sec.cc b/system/stack/btm/btm_sec.cc
index 508a371..7c6a8ed 100644
--- a/system/stack/btm/btm_sec.cc
+++ b/system/stack/btm/btm_sec.cc
@@ -4613,9 +4613,16 @@
  * Returns          Pointer to the record or NULL
  *
  ******************************************************************************/
-void btm_sec_pin_code_request(const RawAddress& p_bda) {
+void btm_sec_pin_code_request(uint8_t* p_event) {
   tBTM_SEC_DEV_REC* p_dev_rec;
   tBTM_CB* p_cb = &btm_cb;
+  RawAddress p_bda;
+
+  STREAM_TO_BDADDR(p_bda, p_event);
+
+  /* Tell L2CAP that there was a PIN code request,  */
+  /* it may need to stretch timeouts                */
+  l2c_pin_code_request(p_bda);
 
   VLOG(2) << __func__ << " BDA: " << p_bda
           << " state: " << btm_pair_state_descr(btm_cb.pairing_state);
diff --git a/system/stack/btu/btu_hcif.cc b/system/stack/btu/btu_hcif.cc
index 2715b8c..7024097 100644
--- a/system/stack/btu/btu_hcif.cc
+++ b/system/stack/btu/btu_hcif.cc
@@ -82,7 +82,6 @@
 static void btu_hcif_hardware_error_evt(uint8_t* p);
 static void btu_hcif_role_change_evt(uint8_t* p);
 static void btu_hcif_mode_change_evt(uint8_t* p);
-static void btu_hcif_pin_code_request_evt(uint8_t* p);
 static void btu_hcif_link_key_request_evt(uint8_t* p);
 static void btu_hcif_link_key_notification_evt(uint8_t* p);
 static void btu_hcif_read_clock_off_comp_evt(uint8_t* p);
@@ -338,7 +337,7 @@
       btu_hcif_mode_change_evt(p);
       break;
     case HCI_PIN_CODE_REQUEST_EVT:
-      btu_hcif_pin_code_request_evt(p);
+      btm_sec_pin_code_request(p);
       break;
     case HCI_LINK_KEY_REQUEST_EVT:
       btu_hcif_link_key_request_evt(p);
@@ -1601,27 +1600,6 @@
 
 /*******************************************************************************
  *
- * Function         btu_hcif_pin_code_request_evt
- *
- * Description      Process event HCI_PIN_CODE_REQUEST_EVT
- *
- * Returns          void
- *
- ******************************************************************************/
-static void btu_hcif_pin_code_request_evt(uint8_t* p) {
-  RawAddress bda;
-
-  STREAM_TO_BDADDR(bda, p);
-
-  /* Tell L2CAP that there was a PIN code request,  */
-  /* it may need to stretch timeouts                */
-  l2c_pin_code_request(bda);
-
-  btm_sec_pin_code_request(bda);
-}
-
-/*******************************************************************************
- *
  * Function         btu_hcif_link_key_request_evt
  *
  * Description      Process event HCI_LINK_KEY_REQUEST_EVT