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

Commit f0a39051 authored by Hunter Knepshield's avatar Hunter Knepshield
Browse files

Fix minor time bug in ConsentCallback::getElapsedTimeMs

Previously, this function was actually returning a value in nanoseconds,
which made any comparisons with milliseconds invalid. This in turn
caused the dumpstate routine to abort too early for bug reports that
finish before the default timeout elapses (e.g. wifi and telephony
report modes).

Fix: 147153946
Test: manual, ensure that an empty report still waits for 30 seconds
  (USER_CONSENT_TIMEOUT_MS) before cancelling the consent dialog

Change-Id: I2b610d3a32148f706e0b2fc2e330a879795fc8ad
parent ba879c75
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@

// TODO: use functions from <chrono> instead
const uint64_t NANOS_PER_SEC = 1000000000;
const uint64_t NANOS_PER_MILLI = 1000000;
uint64_t Nanotime();

// Switches to non-root user and group.
+1 −1
Original line number Diff line number Diff line
@@ -660,7 +660,7 @@ UserConsentResult Dumpstate::ConsentCallback::getResult() {
}

uint64_t Dumpstate::ConsentCallback::getElapsedTimeMs() const {
    return Nanotime() - start_time_;
    return (Nanotime() - start_time_) / NANOS_PER_MILLI;
}

void Dumpstate::PrintHeader() const {