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

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

Merge "Flags 24Q3: Remove dumpsys_acquire_stack_when_executing" into main

parents 0140fae3 139a33d9
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ aconfig_declarations {
        "connectivity.aconfig",
        "device_iot_config.aconfig",
        "dis.aconfig",
        "dumpsys.aconfig",
        "framework.aconfig",
        "gap.aconfig",
        "hal.aconfig",
+0 −1
Original line number Diff line number Diff line
@@ -15,7 +15,6 @@ aconfig("bluetooth_flags_c_lib") {
    "connectivity.aconfig",
    "device_iot_config.aconfig",
    "dis.aconfig",
    "dumpsys.aconfig",
    "framework.aconfig",
    "gap.aconfig",
    "hal.aconfig",

flags/dumpsys.aconfig

deleted100644 → 0
+0 −9
Original line number Diff line number Diff line
package: "com.android.bluetooth.flags"
container: "com.android.btservices"

flag {
    name: "dumpsys_acquire_stack_when_executing"
    namespace: "bluetooth"
    description: "Acquire stack resource when executing"
    bug: "329682970"
}
+6 −22
Original line number Diff line number Diff line
@@ -149,7 +149,6 @@ void Dumpsys::impl::DumpWithArgsAsync(int fd, const char** args) const {
}

void Dumpsys::impl::DumpWithArgsSync(int fd, const char** args, std::promise<void> promise) {
  if (com::android::bluetooth::flags::dumpsys_acquire_stack_when_executing()) {
  if (bluetooth::shim::Stack::GetInstance()->LockForDumpsys([=, *this]() {
        log::info("Started dumpsys procedure");
        this->DumpWithArgsAsync(fd, args);
@@ -158,27 +157,12 @@ void Dumpsys::impl::DumpWithArgsSync(int fd, const char** args, std::promise<voi
  } else {
    log::info("Failed dumpsys procedure as stack was not longer active");
  }
  } else {
    DumpWithArgsAsync(fd, args);
  }
  promise.set_value();
}

Dumpsys::Dumpsys(const std::string& pre_bundled_schema)
    : reflection_schema_(dumpsys::ReflectionSchema(pre_bundled_schema)) {}

// DEPRECATED Flag: dumpsys_acquire_stack_when_executing
void Dumpsys::Dump(int fd, const char** args) {
  if (fd <= 0) {
    return;
  }
  std::promise<void> promise;
  auto future = promise.get_future();
  CallOn(pimpl_.get(), &Dumpsys::impl::DumpWithArgsSync, fd, args, std::move(promise));
  future.get();
}
// !DEPRECATED Flag: dumpsys_acquire_stack_when_executing

void Dumpsys::Dump(int fd, const char** args, std::promise<void> promise) {
  if (fd <= 0) {
    promise.set_value();
+10 −24
Original line number Diff line number Diff line
@@ -55,7 +55,6 @@ void bluetooth::shim::Dump(int fd, const char** args) {
      dumpsys.second(fd);
    }
  }
  if (com::android::bluetooth::flags::dumpsys_acquire_stack_when_executing()) {
  std::promise<void> promise;
  std::future future = promise.get_future();
  if (bluetooth::shim::Stack::GetInstance()->CallOnModule<shim::Dumpsys>(
@@ -67,17 +66,4 @@ void bluetooth::shim::Dump(int fd, const char** args) {
  } else {
    dprintf(fd, "%s NOTE: gd dumpsys module not loaded or started\n", kModuleName);
  }
  } else {  // !FLAG(dumpsys_acquire_stack_when_executing)
    bluetooth::shim::Stack::GetInstance()->LockForDumpsys([=]() {
      if (bluetooth::shim::is_gd_stack_started_up()) {
        if (bluetooth::shim::is_gd_dumpsys_module_started()) {
          bluetooth::shim::GetDumpsys()->Dump(fd, args);
        } else {
          dprintf(fd, "%s NOTE: gd dumpsys module not loaded or started\n", kModuleName);
        }
      } else {
        dprintf(fd, "%s gd stack is enabled but not started\n", kModuleName);
      }
    });
  }
}
Loading