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

Commit d7fda538 authored by Jeffrey Huang's avatar Jeffrey Huang
Browse files

Send puller registration signal to statsd

Bug: 153384066
Test: m -j
Change-Id: Idd2465d52e6720d7bce26ecc7998721b9d9790e3
parent a0222398
Loading
Loading
Loading
Loading
+9 −4
Original line number Original line Diff line number Diff line
@@ -182,6 +182,11 @@ interface IStatsd {
     */
     */
    void sendAppBreadcrumbAtom(int label, int state);
    void sendAppBreadcrumbAtom(int label, int state);


    /**
     * Tell the stats daemon that all the pullers registered during boot have been sent.
     */
    oneway void allPullersFromBootRegistered();

    /**
    /**
     * Registers a puller callback function that, when invoked, pulls the data
     * Registers a puller callback function that, when invoked, pulls the data
     * for the specified atom tag.
     * for the specified atom tag.
+1 −0
Original line number Original line Diff line number Diff line
@@ -600,6 +600,7 @@ public class StatsManagerService extends IStatsManagerService.Stub {
            statsd.registerPullAtomCallback(key.getUid(), key.getAtom(), value.getCoolDownMillis(),
            statsd.registerPullAtomCallback(key.getUid(), key.getAtom(), value.getCoolDownMillis(),
                    value.getTimeoutMillis(), value.getAdditiveFields(), value.getCallback());
                    value.getTimeoutMillis(), value.getAdditiveFields(), value.getCallback());
        }
        }
        statsd.allPullersFromBootRegistered();
    }
    }


    // Pre-condition: the Binder calling identity has already been cleared
    // Pre-condition: the Binder calling identity has already been cleared
+8 −0
Original line number Original line Diff line number Diff line
@@ -1215,6 +1215,14 @@ Status StatsService::sendAppBreadcrumbAtom(int32_t label, int32_t state) {
    return Status::ok();
    return Status::ok();
}
}


Status StatsService::allPullersFromBootRegistered() {
    ENFORCE_UID(AID_SYSTEM);

    VLOG("StatsService::allPullersFromBootRegistered was called");

    return Status::ok();
}

Status StatsService::registerPullAtomCallback(int32_t uid, int32_t atomTag, int64_t coolDownMillis,
Status StatsService::registerPullAtomCallback(int32_t uid, int32_t atomTag, int64_t coolDownMillis,
                                              int64_t timeoutMillis,
                                              int64_t timeoutMillis,
                                              const std::vector<int32_t>& additiveFields,
                                              const std::vector<int32_t>& additiveFields,
+5 −0
Original line number Original line Diff line number Diff line
@@ -164,6 +164,11 @@ public:
     */
     */
    virtual Status sendAppBreadcrumbAtom(int32_t label, int32_t state) override;
    virtual Status sendAppBreadcrumbAtom(int32_t label, int32_t state) override;


    /**
     * Binder call to notify statsd that all pullers from boot have been registered.
     */
    virtual Status allPullersFromBootRegistered();

    /**
    /**
     * Binder call to register a callback function for a pulled atom.
     * Binder call to register a callback function for a pulled atom.
     */
     */