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

Commit e370d689 authored by Abhijeet Kaur's avatar Abhijeet Kaur
Browse files

Sunset legacy bugreport methods

Bugreport is now triggered using API and not via broadcasts from
dumpstate. As migration to API flow is stable, we can remove methods and
broadcasts that were used in non-API bugreport flow.

* Finished broadcasts are handled by Shell when onfinished() is called
  from dumpstate. This is because dumpstate does not have any information
  about the final files (other than their fds).
* Remove system properties title/description as they are handled by
  Shell.
* File rename is not handled by dumpstate as it does not own the final
  files. File rename is handled by the caller of the API (Shell for
  instance).
* Remove system property to read mode and set properties from it. Modify
  tests accordingly. Rename extra_options to bugreport_mode.
* Deprecate do_broadcast flag, as finished notification is no longer
  handled by dumpstate.

Bug: 136066578
Test: Takes interactive/full bugreport as expected
Test: atest dumpstate_test
Test: adb bugreport (works as expected)
Test: adb bugreport br.zip (works as expected)
Change-Id: Ib39798944c4308ae0c87a22a9164567f249adfff
parent fae03b95
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -204,14 +204,13 @@ status_t DumpstateService::dump(int fd, const Vector<String16>&) {
    dprintf(fd, "progress:\n");
    dprintf(fd, "progress:\n");
    ds_->progress_->Dump(fd, "  ");
    ds_->progress_->Dump(fd, "  ");
    dprintf(fd, "args: %s\n", ds_->options_->args.c_str());
    dprintf(fd, "args: %s\n", ds_->options_->args.c_str());
    dprintf(fd, "extra_options: %s\n", ds_->options_->extra_options.c_str());
    dprintf(fd, "bugreport_mode: %s\n", ds_->options_->bugreport_mode.c_str());
    dprintf(fd, "version: %s\n", ds_->version_.c_str());
    dprintf(fd, "version: %s\n", ds_->version_.c_str());
    dprintf(fd, "bugreport_dir: %s\n", destination.c_str());
    dprintf(fd, "bugreport_dir: %s\n", destination.c_str());
    dprintf(fd, "screenshot_path: %s\n", ds_->screenshot_path_.c_str());
    dprintf(fd, "screenshot_path: %s\n", ds_->screenshot_path_.c_str());
    dprintf(fd, "log_path: %s\n", ds_->log_path_.c_str());
    dprintf(fd, "log_path: %s\n", ds_->log_path_.c_str());
    dprintf(fd, "tmp_path: %s\n", ds_->tmp_path_.c_str());
    dprintf(fd, "tmp_path: %s\n", ds_->tmp_path_.c_str());
    dprintf(fd, "path: %s\n", ds_->path_.c_str());
    dprintf(fd, "path: %s\n", ds_->path_.c_str());
    dprintf(fd, "extra_options: %s\n", ds_->options_->extra_options.c_str());
    dprintf(fd, "base_name: %s\n", ds_->base_name_.c_str());
    dprintf(fd, "base_name: %s\n", ds_->base_name_.c_str());
    dprintf(fd, "name: %s\n", ds_->name_.c_str());
    dprintf(fd, "name: %s\n", ds_->name_.c_str());
    dprintf(fd, "now: %ld\n", ds_->now_);
    dprintf(fd, "now: %ld\n", ds_->now_);
+22 −238

File changed.

Preview size limit exceeded, changes collapsed.

+3 −5
Original line number Original line Diff line number Diff line
@@ -359,7 +359,6 @@ class Dumpstate {
        bool use_socket = false;
        bool use_socket = false;
        bool use_control_socket = false;
        bool use_control_socket = false;
        bool do_fb = false;
        bool do_fb = false;
        bool do_broadcast = false;
        bool is_remote_mode = false;
        bool is_remote_mode = false;
        bool show_header_only = false;
        bool show_header_only = false;
        bool do_start_service = false;
        bool do_start_service = false;
@@ -371,16 +370,15 @@ class Dumpstate {
        android::base::unique_fd bugreport_fd;
        android::base::unique_fd bugreport_fd;
        // File descriptor to screenshot file.
        // File descriptor to screenshot file.
        android::base::unique_fd screenshot_fd;
        android::base::unique_fd screenshot_fd;
        // TODO: rename to MODE.
        // Bugreport mode of the bugreport.
        // Extra options passed as system property.
        std::string bugreport_mode;
        std::string extra_options;
        // Command-line arguments as string
        // Command-line arguments as string
        std::string args;
        std::string args;
        // Notification title and description
        // Notification title and description
        std::string notification_title;
        std::string notification_title;
        std::string notification_description;
        std::string notification_description;


        /* Initializes options from commandline arguments and system properties. */
        /* Initializes options from commandline arguments. */
        RunStatus Initialize(int argc, char* argv[]);
        RunStatus Initialize(int argc, char* argv[]);


        /* Initializes options from the requested mode. */
        /* Initializes options from the requested mode. */
+0 −1
Original line number Original line Diff line number Diff line
@@ -195,7 +195,6 @@ class ZippedBugreportGenerationTest : public Test {
    static Dumpstate& ds;
    static Dumpstate& ds;
    static std::chrono::milliseconds duration;
    static std::chrono::milliseconds duration;
    static void SetUpTestCase() {
    static void SetUpTestCase() {
        property_set("dumpstate.options", "bugreportplus");
        // clang-format off
        // clang-format off
        char* argv[] = {
        char* argv[] = {
            (char*)"dumpstate",
            (char*)"dumpstate",
+9 −118

File changed.

Preview size limit exceeded, changes collapsed.