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

Commit 787fe2cd authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Migrate pullSystemUptime"

parents 4c0487a1 ce29fc1e
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -844,13 +844,6 @@ public class StatsCompanionService extends IStatsCompanionService.Stub {
        pulledData.add(e);
    }

    private void pullSystemUpTime(int tagId, long elapsedNanos, long wallClockNanos,
            List<StatsLogEventWrapper> pulledData) {
        StatsLogEventWrapper e = new StatsLogEventWrapper(tagId, elapsedNanos, wallClockNanos);
        e.writeLong(SystemClock.uptimeMillis());
        pulledData.add(e);
    }

    private void pullProcessMemoryState(
            int tagId, long elapsedNanos, long wallClockNanos,
            List<StatsLogEventWrapper> pulledData) {
@@ -2049,11 +2042,6 @@ public class StatsCompanionService extends IStatsCompanionService.Stub {
                break;
            }

            case StatsLog.SYSTEM_UPTIME: {
                pullSystemUpTime(tagId, elapsedNanos, wallClockNanos, ret);
                break;
            }

            case StatsLog.SYSTEM_ELAPSED_REALTIME: {
                pullSystemElapsedRealtime(tagId, elapsedNanos, wallClockNanos, ret);
                break;
+0 −4
Original line number Diff line number Diff line
@@ -87,10 +87,6 @@ std::map<PullerKey, PullAtomInfo> StatsPullerManager::kAllPullAtomInfo = {
          .pullTimeoutNs = NS_PER_SEC / 2,
         }},

        // system_uptime
        {{.atomTag = android::util::SYSTEM_UPTIME},
         {.puller = new StatsCompanionServicePuller(android::util::SYSTEM_UPTIME)}},

        // remaining_battery_capacity
        {{.atomTag = android::util::REMAINING_BATTERY_CAPACITY},
         {.puller = new ResourceHealthManagerPuller(android::util::REMAINING_BATTERY_CAPACITY)}},
+14 −3
Original line number Diff line number Diff line
@@ -841,11 +841,22 @@ public class StatsPullAtomService extends SystemService {
    }

    private void registerSystemUptime() {
        // No op.
        int tagId = StatsLog.SYSTEM_UPTIME;
        mStatsManager.registerPullAtomCallback(
                tagId,
                null, // use default PullAtomMetadata values
                (atomTag, data) -> pullSystemUptime(atomTag, data),
                Executors.newSingleThreadExecutor()
        );
    }

    private void pullSystemUptime() {
        // No op.
    private int pullSystemUptime(int atomTag, List<StatsEvent> pulledData) {
        StatsEvent e = StatsEvent.newBuilder()
                .setAtomId(atomTag)
                .writeLong(SystemClock.elapsedRealtime())
                .build();
        pulledData.add(e);
        return StatsManager.PULL_SUCCESS;
    }

    private void registerRemainingBatteryCapacity() {