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

Commit 658a9f79 authored by Greg Kaiser's avatar Greg Kaiser
Browse files

Fix regression due to lack of braces

We didn't use braces {} for a conditional, and we added another
statement below it.  This had us only executing the first statement
when the 'if' was true, and then returning an error in all cases.

We use braces to fix this, and also fix the other indenting.

Test: TreeHugger
Bug: 193268714
Change-Id: Ib26c0d0ab7f47451aa4980b06886e5e7fd2a0805
parent dab680a3
Loading
Loading
Loading
Loading
+7 −6
Original line number Original line Diff line number Diff line
@@ -417,11 +417,12 @@ tHID_STATUS HID_HostOpenDev(uint8_t dev_handle) {
  if (!hh_cb.reg_flag) return (HID_ERR_NOT_REGISTERED);
  if (!hh_cb.reg_flag) return (HID_ERR_NOT_REGISTERED);


  if ((dev_handle >= HID_HOST_MAX_DEVICES) ||
  if ((dev_handle >= HID_HOST_MAX_DEVICES) ||
      (!hh_cb.devices[dev_handle].in_use))
      (!hh_cb.devices[dev_handle].in_use)) {
    log_counter_metrics(android::bluetooth::CodePathCounterKeyEnum::
    log_counter_metrics(android::bluetooth::CodePathCounterKeyEnum::
                            HIDH_ERR_INVALID_PARAM_AT_HOST_OPEN_DEV,
                            HIDH_ERR_INVALID_PARAM_AT_HOST_OPEN_DEV,
                        1);
                        1);
    return HID_ERR_INVALID_PARAM;
    return HID_ERR_INVALID_PARAM;
  }


  if (hh_cb.devices[dev_handle].state != HID_DEV_NO_CONN) {
  if (hh_cb.devices[dev_handle].state != HID_DEV_NO_CONN) {
    log_counter_metrics(
    log_counter_metrics(