vold: const-ify some of the API
We make some of the C++ member functions 'const', to reflect how
they (don't) affect the state of the class.
Test: TreeHugger
Change-Id: Iec1c2801bfe721e2741406ed1ac0ef95662840a6
diff --git a/model/Disk.h b/model/Disk.h
index 3140144..889e906 100644
--- a/model/Disk.h
+++ b/model/Disk.h
@@ -54,18 +54,18 @@
kEmmc = 1 << 4,
};
- const std::string& getId() { return mId; }
- const std::string& getEventPath() { return mEventPath; }
- const std::string& getSysPath() { return mSysPath; }
- const std::string& getDevPath() { return mDevPath; }
- dev_t getDevice() { return mDevice; }
- uint64_t getSize() { return mSize; }
- const std::string& getLabel() { return mLabel; }
- int getFlags() { return mFlags; }
+ const std::string& getId() const { return mId; }
+ const std::string& getEventPath() const { return mEventPath; }
+ const std::string& getSysPath() const { return mSysPath; }
+ const std::string& getDevPath() const { return mDevPath; }
+ dev_t getDevice() const { return mDevice; }
+ uint64_t getSize() const { return mSize; }
+ const std::string& getLabel() const { return mLabel; }
+ int getFlags() const { return mFlags; }
std::shared_ptr<VolumeBase> findVolume(const std::string& id);
- void listVolumes(VolumeBase::Type type, std::list<std::string>& list);
+ void listVolumes(VolumeBase::Type type, std::list<std::string>& list) const;
status_t create();
status_t destroy();