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

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

Merge "Fix puller callback with gauge/value metric" into qt-dev

parents db797218 de473b51
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -276,7 +276,8 @@ bool StatsPullerManager::Pull(int tagId, vector<shared_ptr<LogEvent>>* data) {
}

bool StatsPullerManager::PullerForMatcherExists(int tagId) const {
    return kAllPullAtomInfo.find(tagId) != kAllPullAtomInfo.end();
    // Vendor pulled atoms might be registered after we parse the config.
    return isVendorPulledAtom(tagId) || kAllPullAtomInfo.find(tagId) != kAllPullAtomInfo.end();
}

void StatsPullerManager::updateAlarmLocked() {
@@ -449,9 +450,8 @@ void StatsPullerManager::RegisterPullerCallback(int32_t atomTag,
        const sp<IStatsPullerCallback>& callback) {
    AutoMutex _l(mLock);
    // Platform pullers cannot be changed.
    if (atomTag < StatsdStats::kMaxPlatformAtomTag) {
        VLOG("RegisterPullerCallback: atom tag %d is less than min tag %d",
                atomTag, StatsdStats::kMaxPlatformAtomTag);
    if (!isVendorPulledAtom(atomTag)) {
        VLOG("RegisterPullerCallback: atom tag %d is not vendor pulled", atomTag);
        return;
    }
    VLOG("RegisterPullerCallback: adding puller for tag %d", atomTag);
@@ -462,7 +462,7 @@ void StatsPullerManager::RegisterPullerCallback(int32_t atomTag,
void StatsPullerManager::UnregisterPullerCallback(int32_t atomTag) {
    AutoMutex _l(mLock);
    // Platform pullers cannot be changed.
    if (atomTag < StatsdStats::kMaxPlatformAtomTag) {
    if (!isVendorPulledAtom(atomTag)) {
        return;
    }
    StatsdStats::getInstance().notePullerCallbackRegistrationChanged(atomTag, /*registered=*/false);
+6 −0
Original line number Diff line number Diff line
@@ -160,6 +160,12 @@ public:
    // Max platform atom tag number.
    static const int32_t kMaxPlatformAtomTag = 100000;

    // Vendor pulled atom start id.
    static const int32_t kVendorPulledAtomStartTag = 150000;

    // Max accepted atom id.
    static const int32_t kMaxAtomTag = 200000;

    static const int64_t kInt64Max = 0x7fffffffffffffffLL;

    /**
+4 −0
Original line number Diff line number Diff line
@@ -96,6 +96,10 @@ inline bool isPushedAtom(int atomId) {
    return atomId <= util::kMaxPushedAtomId && atomId > 1;
}

inline bool isVendorPulledAtom(int atomId) {
    return atomId >= StatsdStats::kVendorPulledAtomStartTag && atomId < StatsdStats::kMaxAtomTag;
}

}  // namespace statsd
}  // namespace os
}  // namespace android