Send puller registration signal to statsd

Bug: 153384066
Test: m -j
Change-Id: Idd2465d52e6720d7bce26ecc7998721b9d9790e3
This commit is contained in:
Jeffrey Huang
2020-04-06 18:19:46 -07:00
parent a0222398c5
commit d7fda53855
4 changed files with 23 additions and 4 deletions

View File

@@ -182,10 +182,15 @@ interface IStatsd {
*/
void sendAppBreadcrumbAtom(int label, int state);
/**
* Registers a puller callback function that, when invoked, pulls the data
* for the specified atom tag.
*/
/**
* 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
* for the specified atom tag.
*/
oneway void registerPullAtomCallback(int uid, int atomTag, long coolDownMillis,
long timeoutMillis,in int[] additiveFields,
IPullAtomCallback pullerCallback);

View File

@@ -600,6 +600,7 @@ public class StatsManagerService extends IStatsManagerService.Stub {
statsd.registerPullAtomCallback(key.getUid(), key.getAtom(), value.getCoolDownMillis(),
value.getTimeoutMillis(), value.getAdditiveFields(), value.getCallback());
}
statsd.allPullersFromBootRegistered();
}
// Pre-condition: the Binder calling identity has already been cleared

View File

@@ -1215,6 +1215,14 @@ Status StatsService::sendAppBreadcrumbAtom(int32_t label, int32_t state) {
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,
int64_t timeoutMillis,
const std::vector<int32_t>& additiveFields,

View File

@@ -164,6 +164,11 @@ public:
*/
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.
*/