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

Commit dd6a5089 authored by Tom Cherry's avatar Tom Cherry Committed by android-build-merger
Browse files

Merge "system property: property set without time spent asleep" am: 0f656508 am: 2b4d5e69

am: daef77ed

Change-Id: I98468056a3d6c720c48bdb6941d9b0f9def9949f
parents c5442602 daef77ed
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -350,9 +350,11 @@ class SocketConnection {
    ufds[0].events = POLLIN;
    ufds[0].revents = 0;
    while (*timeout_ms > 0) {
      Timer timer;
        auto start_time = std::chrono::steady_clock::now();
        int nr = poll(ufds, 1, *timeout_ms);
      uint64_t millis = timer.duration().count();
        auto now = std::chrono::steady_clock::now();
        auto time_elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(now - start_time);
        uint64_t millis = time_elapsed.count();
        *timeout_ms = (millis > *timeout_ms) ? 0 : *timeout_ms - millis;

        if (nr > 0) {