MediaMetrics: Make Item final

Test: atest mediametrics_tests
Bug: 138583596
Change-Id: Ibab0eff8f1d4e9786b366dcc19589b0a8ec2137f
gugelfrei
Andy Hung 5 years ago
parent 2ecacc4ae5
commit 565cc485a0

@ -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;

Loading…
Cancel
Save