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

Commit 1488263c authored by Steven Moreland's avatar Steven Moreland Committed by Android Build Coastguard Worker
Browse files

libbinder: uptimeMillis returns int64_t!

This was limiting device uptime to ~1 month. Certainly, devices should
update more frequently, but that decision should not be because of
ubsan!

This is a partial copy of the change
Ifa00c32ee184795b03e16b39ac70ff41ebf00331 here.

Bug: 197336441
Test: TH
Merged-In: Ifa00c32ee184795b03e16b39ac70ff41ebf00331
Change-Id: Ib9f3e63e968ac77f0f6ea6447d586db588e9dbe4
(cherry picked from commit 3ba4963f)
(cherry picked from commit 2be0e8102687043fc60411ba04a7429407cb0f30)
parent e064da97
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -148,7 +148,8 @@ public:

        const bool isVendorService =
            strcmp(ProcessState::self()->getDriverName().c_str(), "/dev/vndbinder") == 0;
        const long timeout = uptimeMillis() + 5000;
        const long timeout = 5000;
        int64_t startTime = uptimeMillis();
        if (!gSystemBootCompleted) {
            char bootCompleted[PROPERTY_VALUE_MAX];
            property_get("sys.boot_completed", bootCompleted, "0");
@@ -158,7 +159,7 @@ public:
        const long sleepTime = gSystemBootCompleted ? 1000 : 100;

        int n = 0;
        while (uptimeMillis() < timeout) {
        while (uptimeMillis() - startTime < timeout) {
            n++;
            if (isVendorService) {
                ALOGI("Waiting for vendor service %s...", String8(name).string());