This patch will immediatly delete the snoop log if Bluetooth is on. If Bluetooth
is off it will delete the log as soon as Bluetooth starts again.
Test: Turn off logging while Bluetooth is on and off
Bug:
36718948
Change-Id: Ib660cd442c93f1a34c948d51c5cffc38695558d5
bool should_log = module_started && (logging_enabled_via_api ||
stack_config->get_btsnoop_turned_on());
+ if (module_started && !should_log) {
+ LOG_INFO(LOG_TAG, "Deleting snoop log if it exists");
+ remove(stack_config->get_btsnoop_log_path());
+ }
+
if (should_log == is_logging) return;
is_logging = should_log;