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

Commit 45fd7efb authored by Jack He's avatar Jack He
Browse files

GD: Add verbose logging to module start-up code

Bug: 184608842
Test: make, start bluetooth
Tag: #gd-refactor
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: Ib883ada4cd64d2adb37fdb00312ab581d7a4d50a
parent efae5e35
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;
}