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

Commit 03f9000a authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6114771 from 68234605 to rvc-release

Change-Id: I1553a877012bf2c3a2d1ccf28450d70d66ec7e78
parents 888c778a 68234605
Loading
Loading
Loading
Loading

system/bta/hh/bta_hh_le.cc

100644 → 100755
+49 −62
Original line number Original line Diff line number Diff line
@@ -66,10 +66,9 @@ static const uint16_t bta_hh_uuid_to_rtp_type[BTA_LE_HID_RTP_UUID_MAX][2] = {


static void bta_hh_gattc_callback(tBTA_GATTC_EVT event, tBTA_GATTC* p_data);
static void bta_hh_gattc_callback(tBTA_GATTC_EVT event, tBTA_GATTC* p_data);
static void bta_hh_le_add_dev_bg_conn(tBTA_HH_DEV_CB* p_cb, bool check_bond);
static void bta_hh_le_add_dev_bg_conn(tBTA_HH_DEV_CB* p_cb, bool check_bond);
// TODO(jpawlowski): uncomment when fixed
static void bta_hh_process_cache_rpt(tBTA_HH_DEV_CB* p_cb,
// static void bta_hh_process_cache_rpt (tBTA_HH_DEV_CB *p_cb,
                                     tBTA_HH_RPT_CACHE_ENTRY* p_rpt_cache,
//                                       tBTA_HH_RPT_CACHE_ENTRY *p_rpt_cache,
                                     uint8_t num_rpt);
//                                       uint8_t num_rpt);


#if (BTA_HH_DEBUG == TRUE)
#if (BTA_HH_DEBUG == TRUE)
static const char* bta_hh_le_rpt_name[4] = {"UNKNOWN", "INPUT", "OUTPUT",
static const char* bta_hh_le_rpt_name[4] = {"UNKNOWN", "INPUT", "OUTPUT",
@@ -1001,14 +1000,12 @@ void bta_hh_security_cmpl(tBTA_HH_DEV_CB* p_cb,
      APPL_TRACE_DEBUG("bta_hh_security_cmpl no reports loaded, try to load");
      APPL_TRACE_DEBUG("bta_hh_security_cmpl no reports loaded, try to load");


      /* start loading the cache if not in stack */
      /* start loading the cache if not in stack */
      // TODO(jpawlowski): cache storage is broken, fix it
      tBTA_HH_RPT_CACHE_ENTRY* p_rpt_cache;
      // tBTA_HH_RPT_CACHE_ENTRY     *p_rpt_cache;
      uint8_t num_rpt = 0;
      // uint8_t                       num_rpt = 0;
      if ((p_rpt_cache = bta_hh_le_co_cache_load(p_cb->addr, &num_rpt,
      // if ((p_rpt_cache = bta_hh_le_co_cache_load(p_cb->addr, &num_rpt,
                                                 p_cb->app_id)) != NULL) {
      // p_cb->app_id)) != NULL)
        bta_hh_process_cache_rpt(p_cb, p_rpt_cache, num_rpt);
      // {
      }
      //     bta_hh_process_cache_rpt(p_cb, p_rpt_cache, num_rpt);
      // }
    }
    }
    /*  discovery has been done for HID service */
    /*  discovery has been done for HID service */
    if (p_cb->app_id != 0 && p_cb->hid_srvc.in_use) {
    if (p_cb->app_id != 0 && p_cb->hid_srvc.in_use) {
@@ -1576,9 +1573,11 @@ void bta_hh_le_input_rpt_notify(tBTA_GATTC_NOTIFY* p_data) {


  app_id = p_dev_cb->app_id;
  app_id = p_dev_cb->app_id;


  p_rpt =
  const gatt::Service* p_svc =
      bta_hh_le_find_report_entry(p_dev_cb, p_dev_cb->hid_srvc.srvc_inst_id,
      BTA_GATTC_GetOwningService(p_dev_cb->conn_id, p_char->value_handle);
                                  p_char->uuid.As16Bit(), p_char->value_handle);

  p_rpt = bta_hh_le_find_report_entry(
      p_dev_cb, p_svc->handle, p_char->uuid.As16Bit(), p_char->value_handle);
  if (p_rpt == NULL) {
  if (p_rpt == NULL) {
    APPL_TRACE_ERROR(
    APPL_TRACE_ERROR(
        "%s: notification received for Unknown Report, uuid: %s, handle: "
        "%s: notification received for Unknown Report, uuid: %s, handle: "
@@ -2165,52 +2164,40 @@ void bta_hh_le_hid_read_rpt_clt_cfg(const RawAddress& bd_addr, uint8_t rpt_id) {
 * Parameters:
 * Parameters:
 *
 *
 ******************************************************************************/
 ******************************************************************************/
// TODO(jpawlowski): uncomment when fixed
static void bta_hh_process_cache_rpt(tBTA_HH_DEV_CB* p_cb,
// static void bta_hh_process_cache_rpt (tBTA_HH_DEV_CB *p_cb,
                                     tBTA_HH_RPT_CACHE_ENTRY* p_rpt_cache,
//                                       tBTA_HH_RPT_CACHE_ENTRY *p_rpt_cache,
                                     uint8_t num_rpt) {
//                                       uint8_t num_rpt)
  uint8_t i = 0;
// {
  tBTA_HH_LE_RPT* p_rpt;
//     uint8_t                       i = 0;

//     tBTA_HH_LE_RPT              *p_rpt;
  if (num_rpt != 0) /* no cache is found */

  {
//     if (num_rpt != 0)  /* no cache is found */
    p_cb->hid_srvc.in_use = true;
//     {

//         p_cb->hid_srvc.in_use = true;
    /* set the descriptor info */

    p_cb->hid_srvc.descriptor.dl_len = p_cb->dscp_info.descriptor.dl_len;
//         /* set the descriptor info */
    p_cb->hid_srvc.descriptor.dsc_list = p_cb->dscp_info.descriptor.dsc_list;
//         p_cb->hid_srvc.descriptor.dl_len =

//                 p_cb->dscp_info.descriptor.dl_len;
    for (; i < num_rpt; i++, p_rpt_cache++) {
//         p_cb->hid_srvc.descriptor.dsc_list =
      if ((p_rpt = bta_hh_le_find_alloc_report_entry(
//                     p_cb->dscp_info.descriptor.dsc_list;
               p_cb, p_rpt_cache->srvc_inst_id, p_rpt_cache->rpt_uuid,

               p_rpt_cache->char_inst_id)) == NULL) {
//         for (; i <num_rpt; i ++, p_rpt_cache ++)
        APPL_TRACE_ERROR(
//         {
            "bta_hh_process_cache_rpt: allocation report entry failure");
//             if ((p_rpt = bta_hh_le_find_alloc_report_entry (p_cb,
        break;
//                                                p_rpt_cache->srvc_inst_id,
      } else {
//                                                p_rpt_cache->rpt_uuid,
        p_rpt->rpt_type = p_rpt_cache->rpt_type;
//                                                p_rpt_cache->char_inst_id,
        p_rpt->rpt_id = p_rpt_cache->rpt_id;
//                                                p_rpt_cache->prop))  == NULL)

//             {
        if (p_rpt->uuid == GATT_UUID_HID_BT_KB_INPUT ||
//                 APPL_TRACE_ERROR("bta_hh_process_cache_rpt: allocation report
            p_rpt->uuid == GATT_UUID_HID_BT_MOUSE_INPUT ||
//                 entry failure");
            (p_rpt->uuid == GATT_UUID_HID_REPORT &&
//                 break;
             p_rpt->rpt_type == BTA_HH_RPTT_INPUT)) {
//             }
          p_rpt->client_cfg_value = GATT_CLT_CONFIG_NOTIFICATION;
//             else
        }
//             {
      }
//                 p_rpt->rpt_type =  p_rpt_cache->rpt_type;
    }
//                 p_rpt->rpt_id   =  p_rpt_cache->rpt_id;
  }

}
//                 if (p_rpt->uuid == GATT_UUID_HID_BT_KB_INPUT ||
//                     p_rpt->uuid == GATT_UUID_HID_BT_MOUSE_INPUT ||
//                     (p_rpt->uuid == GATT_UUID_HID_REPORT && p_rpt->rpt_type
//                     == BTA_HH_RPTT_INPUT))
//                 {
//                     p_rpt->client_cfg_value =
//                     GATT_CLT_CONFIG_NOTIFICATION;
//                 }
//             }
//         }
//     }
// }


#endif
#endif
+17 −8
Original line number Original line Diff line number Diff line
@@ -135,6 +135,7 @@ cc_binary {
        ":BluetoothFacade_hci_hal",
        ":BluetoothFacade_hci_hal",
        ":BluetoothFacade_hci_layer",
        ":BluetoothFacade_hci_layer",
        ":BluetoothFacade_l2cap_layer",
        ":BluetoothFacade_l2cap_layer",
        ":BluetoothFacade_neighbor",
        ":BluetoothFacade_security_layer",
        ":BluetoothFacade_security_layer",
    ],
    ],
    generated_headers: [
    generated_headers: [
@@ -397,8 +398,9 @@ filegroup {
        "facade/common.proto",
        "facade/common.proto",
        "facade/rootservice.proto",
        "facade/rootservice.proto",
        "hal/facade.proto",
        "hal/facade.proto",
        "hci/facade.proto",
        "hci/facade/facade.proto",
        "hci/facade/le_advertising_manager_facade.proto",
        "hci/facade/le_advertising_manager_facade.proto",
        "neighbor/facade/facade.proto",
        "l2cap/classic/facade.proto",
        "l2cap/classic/facade.proto",
        "security/facade.proto",
        "security/facade.proto",
    ],
    ],
@@ -421,12 +423,14 @@ genrule {
        "facade/rootservice.pb.h",
        "facade/rootservice.pb.h",
        "hal/facade.grpc.pb.h",
        "hal/facade.grpc.pb.h",
        "hal/facade.pb.h",
        "hal/facade.pb.h",
        "hci/facade.grpc.pb.h",
        "hci/facade/facade.grpc.pb.h",
        "hci/facade.pb.h",
        "hci/facade/facade.pb.h",
        "hci/facade/le_advertising_manager_facade.grpc.pb.h",
        "hci/facade/le_advertising_manager_facade.grpc.pb.h",
        "hci/facade/le_advertising_manager_facade.pb.h",
        "hci/facade/le_advertising_manager_facade.pb.h",
        "l2cap/classic/facade.grpc.pb.h",
        "l2cap/classic/facade.grpc.pb.h",
        "l2cap/classic/facade.pb.h",
        "l2cap/classic/facade.pb.h",
        "neighbor/facade/facade.grpc.pb.h",
        "neighbor/facade/facade.pb.h",
        "security/facade.grpc.pb.h",
        "security/facade.grpc.pb.h",
        "security/facade.pb.h",
        "security/facade.pb.h",
    ],
    ],
@@ -449,12 +453,14 @@ genrule {
        "facade/rootservice.pb.cc",
        "facade/rootservice.pb.cc",
        "hal/facade.grpc.pb.cc",
        "hal/facade.grpc.pb.cc",
        "hal/facade.pb.cc",
        "hal/facade.pb.cc",
        "hci/facade.grpc.pb.cc",
        "hci/facade/facade.grpc.pb.cc",
        "hci/facade.pb.cc",
        "hci/facade/facade.pb.cc",
        "hci/facade/le_advertising_manager_facade.grpc.pb.cc",
        "hci/facade/le_advertising_manager_facade.grpc.pb.cc",
        "hci/facade/le_advertising_manager_facade.pb.cc",
        "hci/facade/le_advertising_manager_facade.pb.cc",
        "l2cap/classic/facade.grpc.pb.cc",
        "l2cap/classic/facade.grpc.pb.cc",
        "l2cap/classic/facade.pb.cc",
        "l2cap/classic/facade.pb.cc",
        "neighbor/facade/facade.grpc.pb.cc",
        "neighbor/facade/facade.pb.cc",
        "security/facade.grpc.pb.cc",
        "security/facade.grpc.pb.cc",
        "security/facade.pb.cc",
        "security/facade.pb.cc",
    ],
    ],
@@ -474,6 +480,7 @@ genrule {
        "touch $(genDir)/hci/cert/__init__.py; " +
        "touch $(genDir)/hci/cert/__init__.py; " +
        "touch $(genDir)/l2cap/classic/__init__.py; " +
        "touch $(genDir)/l2cap/classic/__init__.py; " +
        "touch $(genDir)/l2cap/classic/cert/__init__.py; " +
        "touch $(genDir)/l2cap/classic/cert/__init__.py; " +
        "touch $(genDir)/neighbor/facade/__init__.py; " +
        "touch $(genDir)/security/__init__.py; ",
        "touch $(genDir)/security/__init__.py; ",
    srcs: [
    srcs: [
        ":BluetoothFacadeProto",
        ":BluetoothFacadeProto",
@@ -490,15 +497,17 @@ genrule {
        "hal/__init__.py",
        "hal/__init__.py",
        "hal/facade_pb2_grpc.py",
        "hal/facade_pb2_grpc.py",
        "hal/facade_pb2.py",
        "hal/facade_pb2.py",
        "hci/__init__.py",
        "hci/facade_pb2_grpc.py",
        "hci/facade_pb2.py",
        "hci/facade/__init__.py",
        "hci/facade/__init__.py",
        "hci/facade/facade_pb2_grpc.py",
        "hci/facade/facade_pb2.py",
        "hci/facade/le_advertising_manager_facade_pb2_grpc.py",
        "hci/facade/le_advertising_manager_facade_pb2_grpc.py",
        "hci/facade/le_advertising_manager_facade_pb2.py",
        "hci/facade/le_advertising_manager_facade_pb2.py",
        "l2cap/classic/__init__.py",
        "l2cap/classic/__init__.py",
        "l2cap/classic/facade_pb2_grpc.py",
        "l2cap/classic/facade_pb2_grpc.py",
        "l2cap/classic/facade_pb2.py",
        "l2cap/classic/facade_pb2.py",
        "neighbor/facade/__init__.py",
        "neighbor/facade/facade_pb2_grpc.py",
        "neighbor/facade/facade_pb2.py",
        "hci/cert/__init__.py",
        "hci/cert/__init__.py",
        "hci/cert/api_pb2_grpc.py",
        "hci/cert/api_pb2_grpc.py",
        "hci/cert/api_pb2.py",
        "hci/cert/api_pb2.py",
+3 −0
Original line number Original line Diff line number Diff line
CertSelfTest
CertSelfTest
SimpleHalTest
SimpleHalTest
DirectHciTest
LeAdvertisingManagerTest
SimpleSecurityTest
SimpleSecurityTest
NeighborTest
+8 −4
Original line number Original line Diff line number Diff line
@@ -14,11 +14,14 @@
#   See the License for the specific language governing permissions and
#   See the License for the specific language governing permissions and
#   limitations under the License.
#   limitations under the License.


import logging

from facade import rootservice_pb2_grpc as facade_rootservice_pb2_grpc
from facade import rootservice_pb2_grpc as facade_rootservice_pb2_grpc
from gd_device_base import GdDeviceBase, GdDeviceConfigError, replace_vars
from gd_device_base import GdDeviceBase, GdDeviceConfigError, replace_vars
from hal import facade_pb2_grpc as hal_facade_pb2_grpc
from hal import facade_pb2_grpc as hal_facade_pb2_grpc
from hci import facade_pb2_grpc as hci_facade_pb2_grpc
from hci.facade import facade_pb2_grpc as hci_facade_pb2_grpc
from hci.facade import le_advertising_manager_facade_pb2_grpc
from hci.facade import le_advertising_manager_facade_pb2_grpc
from neighbor.facade import facade_pb2_grpc as neighbor_facade_pb2_grpc
from l2cap.classic import facade_pb2_grpc as l2cap_facade_pb2_grpc
from l2cap.classic import facade_pb2_grpc as l2cap_facade_pb2_grpc
from security import facade_pb2_grpc as security_facade_pb2_grpc
from security import facade_pb2_grpc as security_facade_pb2_grpc


@@ -52,6 +55,7 @@ def get_instances_with_configs(configs):
    for config in configs:
    for config in configs:
        resolved_cmd = []
        resolved_cmd = []
        for entry in config["cmd"]:
        for entry in config["cmd"]:
            logging.debug(entry)
            resolved_cmd.append(replace_vars(entry, config))
            resolved_cmd.append(replace_vars(entry, config))
        devices.append(
        devices.append(
            GdDevice(config["grpc_port"], config["grpc_root_server_port"],
            GdDevice(config["grpc_port"], config["grpc_root_server_port"],
@@ -72,12 +76,12 @@ class GdDevice(GdDeviceBase):
        self.hal = hal_facade_pb2_grpc.HciHalFacadeStub(self.grpc_channel)
        self.hal = hal_facade_pb2_grpc.HciHalFacadeStub(self.grpc_channel)
        self.controller_read_only_property = facade_rootservice_pb2_grpc.ReadOnlyPropertyStub(
        self.controller_read_only_property = facade_rootservice_pb2_grpc.ReadOnlyPropertyStub(
            self.grpc_channel)
            self.grpc_channel)
        self.hci = hci_facade_pb2_grpc.AclManagerFacadeStub(self.grpc_channel)
        self.hci = hci_facade_pb2_grpc.HciLayerFacadeStub(self.grpc_channel)
        self.hci_classic_security = hci_facade_pb2_grpc.ClassicSecurityManagerFacadeStub(
            self.grpc_channel)
        self.l2cap = l2cap_facade_pb2_grpc.L2capClassicModuleFacadeStub(
        self.l2cap = l2cap_facade_pb2_grpc.L2capClassicModuleFacadeStub(
            self.grpc_channel)
            self.grpc_channel)
        self.hci_le_advertising_manager = le_advertising_manager_facade_pb2_grpc.LeAdvertisingManagerFacadeStub(
        self.hci_le_advertising_manager = le_advertising_manager_facade_pb2_grpc.LeAdvertisingManagerFacadeStub(
            self.grpc_channel)
            self.grpc_channel)
        self.neighbor = neighbor_facade_pb2_grpc.NeighborFacadeStub(
            self.grpc_channel)
        self.security = security_facade_pb2_grpc.SecurityModuleFacadeStub(
        self.security = security_facade_pb2_grpc.SecurityModuleFacadeStub(
            self.grpc_channel)
            self.grpc_channel)
+6 −3
Original line number Original line Diff line number Diff line
@@ -22,8 +22,10 @@
#include "facade/rootservice.grpc.pb.h"
#include "facade/rootservice.grpc.pb.h"
#include "grpc/grpc_module.h"
#include "grpc/grpc_module.h"
#include "hal/facade.h"
#include "hal/facade.h"
#include "hci/facade.h"
#include "hci/facade/facade.h"
#include "hci/facade/le_advertising_manager_facade.h"
#include "l2cap/classic/facade.h"
#include "l2cap/classic/facade.h"
#include "neighbor/facade/facade.h"
#include "os/log.h"
#include "os/log.h"
#include "os/thread.h"
#include "os/thread.h"
#include "security/facade.h"
#include "security/facade.h"
@@ -56,8 +58,9 @@ class RootFacadeService : public ::bluetooth::facade::RootFacade::Service {
        break;
        break;
      case BluetoothModule::HCI:
      case BluetoothModule::HCI:
        modules.add<::bluetooth::facade::ReadOnlyPropertyServerModule>();
        modules.add<::bluetooth::facade::ReadOnlyPropertyServerModule>();
        modules.add<::bluetooth::hci::AclManagerFacadeModule>();
        modules.add<::bluetooth::hci::facade::HciLayerFacadeModule>();
        modules.add<::bluetooth::hci::ClassicSecurityManagerFacadeModule>();
        modules.add<::bluetooth::hci::facade::LeAdvertisingManagerFacadeModule>();
        modules.add<::bluetooth::neighbor::facade::NeighborFacadeModule>();
        break;
        break;
      case BluetoothModule::L2CAP:
      case BluetoothModule::L2CAP:
        modules.add<::bluetooth::facade::ReadOnlyPropertyServerModule>();
        modules.add<::bluetooth::facade::ReadOnlyPropertyServerModule>();
Loading