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

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

Merge "MediaMetric: set maximum properties as 128." into udc-dev

parents 76a1033a 0fd8502b
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -143,6 +143,7 @@ private:
            if (mPropertyMap.size() >= kKeyMaxProperties &&
                    !mPropertyMap.count(property)) {
                ALOGV("%s: too many properties, rejecting %s", __func__, property.c_str());
                mRejectedPropertiesCount++;
                return;
            }
            auto& timeSequence = mPropertyMap[property];
@@ -172,6 +173,10 @@ private:
                    ss << s;
                }
            }
            if (ll > 0 && mRejectedPropertiesCount > 0) {
                ss << "Rejected properties: " << mRejectedPropertiesCount << "\n";
                ll--;
            }
            return { ss.str(), lines - ll };
        }

@@ -214,6 +219,7 @@ private:
        const uid_t mAllowUid;
        const int64_t mCreationTime;

        unsigned int mRejectedPropertiesCount = 0;
        int64_t mLastModificationTime;
        std::map<std::string /* property */, PropertyHistory> mPropertyMap;
    };
@@ -221,7 +227,7 @@ private:
    using History = std::map<std::string /* key */, std::shared_ptr<KeyHistory>>;

    static inline constexpr size_t kTimeSequenceMaxElements = 50;
    static inline constexpr size_t kKeyMaxProperties = 50;
    static inline constexpr size_t kKeyMaxProperties = 128;
    static inline constexpr size_t kKeyLowWaterMark = 400;
    static inline constexpr size_t kKeyHighWaterMark = 500;