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

Commit 565cc485 authored by Andy Hung's avatar Andy Hung
Browse files

MediaMetrics: Make Item final

Test: atest mediametrics_tests
Bug: 138583596
Change-Id: Ibab0eff8f1d4e9786b366dcc19589b0a8ec2137f
parent 2ecacc4a
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -616,7 +616,7 @@ private:
 *
 * The Item is designed for the service as it has getters.
 */
class Item : public mediametrics::BaseItem {
class Item final : public mediametrics::BaseItem {
public:

    class Prop {
@@ -790,6 +790,13 @@ public:
        : mKey(key) { }
    Item() = default;

    // We enable default copy and move constructors and make this class final
    // to prevent a derived class; this avoids possible data slicing.
    Item(const Item& other) = default;
    Item(Item&& other) = default;
    Item& operator=(const Item& other) = default;
    Item& operator=(Item&& other) = default;

    bool operator==(const Item& other) const {
        if (mPid != other.mPid
            || mUid != other.mUid
@@ -991,6 +998,7 @@ private:
        return prop;
    }

    // Changes to member variables below require changes to clear().
    pid_t         mPid = -1;
    uid_t         mUid = -1;
    std::string   mPkgName;