Loading apex/statsd/framework/java/android/app/StatsManager.java +3 −2 Original line number Diff line number Diff line Loading @@ -616,7 +616,7 @@ public final class StatsManager { /** * Set the cool down time of the pull in milliseconds. If two successive pulls are * issued within the cool down, a cached version of the first pull will be used for the * second pull. * second pull. The minimum allowed cool down is 1 second. */ @NonNull public Builder setCoolDownMillis(long coolDownMillis) { Loading @@ -625,7 +625,8 @@ public final class StatsManager { } /** * Set the maximum time the pull can take in milliseconds. * Set the maximum time the pull can take in milliseconds. The maximum allowed timeout * is 10 seconds. */ @NonNull public Builder setTimeoutMillis(long timeoutMillis) { Loading cmds/statsd/src/external/StatsPullerManager.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -313,8 +313,10 @@ void StatsPullerManager::RegisterPullAtomCallback(const int uid, const int32_t a // TODO(b/146439412): linkToDeath with the callback so that we can remove it // and delete the puller. StatsdStats::getInstance().notePullerCallbackRegistrationChanged(atomTag, /*registered=*/true); kAllPullAtomInfo[{.atomTag = atomTag, .uid = useUid ? uid : -1}] = new StatsCallbackPuller(atomTag, callback, coolDownNs, timeoutNs, additiveFields); int64_t actualCoolDownNs = coolDownNs < kMinCoolDownNs ? kMinCoolDownNs : coolDownNs; int64_t actualTimeoutNs = timeoutNs > kMaxTimeoutNs ? kMaxTimeoutNs : timeoutNs; kAllPullAtomInfo[{.atomTag = atomTag, .uid = useUid ? uid : -1}] = new StatsCallbackPuller( atomTag, callback, actualCoolDownNs, actualTimeoutNs, additiveFields); } void StatsPullerManager::UnregisterPullAtomCallback(const int uid, const int32_t atomTag) { Loading cmds/statsd/src/external/StatsPullerManager.h +3 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ public: virtual ~StatsPullerManager() { } // Registers a receiver for tagId. It will be pulled on the nextPullTimeNs // and then every intervalNs thereafter. virtual void RegisterReceiver(int tagId, const ConfigKey& configKey, Loading Loading @@ -124,6 +125,8 @@ public: std::map<const PullerKey, sp<StatsPuller>> kAllPullAtomInfo; private: const static int64_t kMinCoolDownNs = NS_PER_SEC; const static int64_t kMaxTimeoutNs = 10 * NS_PER_SEC; shared_ptr<IStatsCompanionService> mStatsCompanionService = nullptr; // A struct containing an atom id and a Config Key Loading Loading
apex/statsd/framework/java/android/app/StatsManager.java +3 −2 Original line number Diff line number Diff line Loading @@ -616,7 +616,7 @@ public final class StatsManager { /** * Set the cool down time of the pull in milliseconds. If two successive pulls are * issued within the cool down, a cached version of the first pull will be used for the * second pull. * second pull. The minimum allowed cool down is 1 second. */ @NonNull public Builder setCoolDownMillis(long coolDownMillis) { Loading @@ -625,7 +625,8 @@ public final class StatsManager { } /** * Set the maximum time the pull can take in milliseconds. * Set the maximum time the pull can take in milliseconds. The maximum allowed timeout * is 10 seconds. */ @NonNull public Builder setTimeoutMillis(long timeoutMillis) { Loading
cmds/statsd/src/external/StatsPullerManager.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -313,8 +313,10 @@ void StatsPullerManager::RegisterPullAtomCallback(const int uid, const int32_t a // TODO(b/146439412): linkToDeath with the callback so that we can remove it // and delete the puller. StatsdStats::getInstance().notePullerCallbackRegistrationChanged(atomTag, /*registered=*/true); kAllPullAtomInfo[{.atomTag = atomTag, .uid = useUid ? uid : -1}] = new StatsCallbackPuller(atomTag, callback, coolDownNs, timeoutNs, additiveFields); int64_t actualCoolDownNs = coolDownNs < kMinCoolDownNs ? kMinCoolDownNs : coolDownNs; int64_t actualTimeoutNs = timeoutNs > kMaxTimeoutNs ? kMaxTimeoutNs : timeoutNs; kAllPullAtomInfo[{.atomTag = atomTag, .uid = useUid ? uid : -1}] = new StatsCallbackPuller( atomTag, callback, actualCoolDownNs, actualTimeoutNs, additiveFields); } void StatsPullerManager::UnregisterPullAtomCallback(const int uid, const int32_t atomTag) { Loading
cmds/statsd/src/external/StatsPullerManager.h +3 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ public: virtual ~StatsPullerManager() { } // Registers a receiver for tagId. It will be pulled on the nextPullTimeNs // and then every intervalNs thereafter. virtual void RegisterReceiver(int tagId, const ConfigKey& configKey, Loading Loading @@ -124,6 +125,8 @@ public: std::map<const PullerKey, sp<StatsPuller>> kAllPullAtomInfo; private: const static int64_t kMinCoolDownNs = NS_PER_SEC; const static int64_t kMaxTimeoutNs = 10 * NS_PER_SEC; shared_ptr<IStatsCompanionService> mStatsCompanionService = nullptr; // A struct containing an atom id and a Config Key Loading