Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 045be3d9 authored by Zach Johnson's avatar Zach Johnson
Browse files

Fold security level into HID_DevSetSecurityLevel

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Id6a4d6e29dd9e109e1a8ab048ccd9a2422b3b9fe
parent 662b2259
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ void bta_hd_api_enable(tBTA_HD_DATA* p_data) {

  memset(&bta_hd_cb, 0, sizeof(tBTA_HD_CB));

  HID_DevSetSecurityLevel(BTA_SEC_AUTHENTICATE | BTA_SEC_ENCRYPT);
  HID_DevSetSecurityLevel();

  /* store parameters */
  bta_hd_cb.p_cback = p_data->api_enable.p_cback;
+4 −2
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
#include <string.h>

#include "bt_types.h"
#include "bta/include/bta_api.h"
#include "btm_api.h"
#include "btu.h"
#include "hidd_api.h"
@@ -126,10 +127,11 @@ tHID_STATUS HID_DevDeregister(void) {
  return (HID_SUCCESS);
}

tHID_STATUS HID_DevSetSecurityLevel(uint8_t sec_lvl) {
tHID_STATUS HID_DevSetSecurityLevel() {
  HIDD_TRACE_API("%s", __func__);

  if (!BTM_SimpleSetSecurityLevel(BTM_SEC_SERVICE_HIDD_SEC_CTRL, sec_lvl,
  if (!BTM_SimpleSetSecurityLevel(BTM_SEC_SERVICE_HIDD_SEC_CTRL,
                                  BTA_SEC_AUTHENTICATE | BTA_SEC_ENCRYPT,
                                  HID_PSM_CONTROL)) {
    HIDD_TRACE_ERROR("Security Registration 1 failed");
    return (HID_ERR_NO_RESOURCES);
+1 −1
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ extern tHID_STATUS HID_DevDeregister(void);
 * Returns          tHID_STATUS
 *
 ******************************************************************************/
extern tHID_STATUS HID_DevSetSecurityLevel(uint8_t sec_lvl);
extern tHID_STATUS HID_DevSetSecurityLevel();

/*******************************************************************************
 *