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

Commit c5f7ec35 authored by Rhed Jao's avatar Rhed Jao
Browse files

Fixes frequent ANR taking bugreport in background

Remove the task of DumpAppInfos from the parallel running queue
to avoid RunDumpsysNormal and DumpAppInfos running at the same time.
The system_server may be overwhelmed and cause applications anr issues.

Bug: 175747281
Test: atest dumpstate_test
Test: adb bugreport
Change-Id: I2d7fae837938caf271e2e87aade018d1ee8d3175
parent 84544748
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -227,7 +227,6 @@ static const std::string DUMP_INCIDENT_REPORT_TASK = "INCIDENT REPORT";
static const std::string DUMP_HALS_TASK = "DUMP HALS";
static const std::string DUMP_BOARD_TASK = "dumpstate_board()";
static const std::string DUMP_CHECKINS_TASK = "DUMP CHECKINS";
static const std::string DUMP_APP_INFOS_TASK = "DUMP APP INFOS";

namespace android {
namespace os {
@@ -1576,7 +1575,6 @@ static Dumpstate::RunStatus dumpstate() {
        ds.dump_pool_->enqueueTask(DUMP_INCIDENT_REPORT_TASK, &DumpIncidentReport);
        ds.dump_pool_->enqueueTaskWithFd(DUMP_BOARD_TASK, &Dumpstate::DumpstateBoard, &ds, _1);
        ds.dump_pool_->enqueueTaskWithFd(DUMP_CHECKINS_TASK, &DumpCheckins, _1);
        ds.dump_pool_->enqueueTaskWithFd(DUMP_APP_INFOS_TASK, &DumpAppInfos, _1);
    }

    // Dump various things. Note that anything that takes "long" (i.e. several seconds) should
@@ -1729,11 +1727,7 @@ static Dumpstate::RunStatus dumpstate() {
        RUN_SLOW_FUNCTION_WITH_CONSENT_CHECK_AND_LOG(DUMP_CHECKINS_TASK, DumpCheckins);
    }

    if (ds.dump_pool_) {
        WAIT_TASK_WITH_CONSENT_CHECK(DUMP_APP_INFOS_TASK, ds.dump_pool_);
    } else {
        RUN_SLOW_FUNCTION_WITH_CONSENT_CHECK_AND_LOG(DUMP_APP_INFOS_TASK, DumpAppInfos);
    }
    RUN_SLOW_FUNCTION_WITH_CONSENT_CHECK(DumpAppInfos);

    printf("========================================================\n");
    printf("== Dropbox crashes\n");