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

Commit 26636f08 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes Ib883ada4,Ie9d9fb20

* changes:
  GD: Add verbose logging to module start-up code
  GD Controller: Do not register events that are already registered in HCI
parents 09e81714 45fd7efb
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -13,8 +13,10 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#define LOG_TAG "BtGdModule"

#include "module.h"
#include "common/init_flags.h"
#include "dumpsys/init_flags.h"

using ::bluetooth::os::Handler;
@@ -78,16 +80,21 @@ Module* ModuleRegistry::Start(const ModuleFactory* module, Thread* thread) {
    return started_instance->second;
  }

  LOG_DEBUG("Constructing next module");
  Module* instance = module->ctor_();
  last_instance_ = "starting " + instance->ToString();
  set_registry_and_handler(instance, thread);

  LOG_DEBUG("Starting dependencies of %s", instance->ToString().c_str());
  instance->ListDependencies(&instance->dependencies_);
  Start(&instance->dependencies_, thread);

  LOG_DEBUG("Finished starting dependencies and calling Start() of %s", instance->ToString().c_str());

  instance->Start();
  start_order_.push_back(module);
  started_modules_[module] = instance;
  LOG_DEBUG("Started %s", instance->ToString().c_str());
  return instance;
}

+4 −1
Original line number Diff line number Diff line
@@ -165,9 +165,12 @@ static bool event_already_registered_in_hci_layer(
    case bluetooth::hci::EventCode::COMMAND_STATUS:
    case bluetooth::hci::EventCode::PAGE_SCAN_REPETITION_MODE_CHANGE:
    case bluetooth::hci::EventCode::MAX_SLOTS_CHANGE:
    case bluetooth::hci::EventCode::LE_META_EVENT:
      return bluetooth::shim::is_gd_hci_enabled() ||
             bluetooth::shim::is_gd_acl_enabled() ||
             bluetooth::shim::is_gd_l2cap_enabled();
    case bluetooth::hci::EventCode::DISCONNECTION_COMPLETE:
    case bluetooth::hci::EventCode::READ_REMOTE_VERSION_INFORMATION_COMPLETE:
    case bluetooth::hci::EventCode::LE_META_EVENT:
      return bluetooth::shim::is_gd_acl_enabled() ||
             bluetooth::shim::is_gd_l2cap_enabled();
    default: