idmap2: use 'override' where possible
Sprinkle idmap2 with the override specifier to help the compiler catch future errors. Test: builds Change-Id: I6932c5a80ac607f310e256620194e04acfd19ffd
This commit is contained in:
committed by
Todd Kennedy
parent
f1c8cca263
commit
cb85d9c594
@@ -34,18 +34,19 @@ class Idmap2Service : public BinderService<Idmap2Service>, public BnIdmap2 {
|
||||
}
|
||||
|
||||
binder::Status getIdmapPath(const std::string& overlay_apk_path, int32_t user_id,
|
||||
std::string* _aidl_return);
|
||||
std::string* _aidl_return) override;
|
||||
|
||||
binder::Status removeIdmap(const std::string& overlay_apk_path, int32_t user_id,
|
||||
bool* _aidl_return);
|
||||
bool* _aidl_return) override;
|
||||
|
||||
binder::Status verifyIdmap(const std::string& overlay_apk_path, int32_t fulfilled_policies,
|
||||
bool enforce_overlayable, int32_t user_id, bool* _aidl_return);
|
||||
bool enforce_overlayable, int32_t user_id,
|
||||
bool* _aidl_return) override;
|
||||
|
||||
binder::Status createIdmap(const std::string& target_apk_path,
|
||||
const std::string& overlay_apk_path, int32_t fulfilled_policies,
|
||||
bool enforce_overlayable, int32_t user_id,
|
||||
std::unique_ptr<std::string>* _aidl_return);
|
||||
std::unique_ptr<std::string>* _aidl_return) override;
|
||||
};
|
||||
|
||||
} // namespace android::os
|
||||
|
||||
@@ -29,11 +29,12 @@ class BinaryStreamVisitor : public Visitor {
|
||||
public:
|
||||
explicit BinaryStreamVisitor(std::ostream& stream) : stream_(stream) {
|
||||
}
|
||||
virtual void visit(const Idmap& idmap);
|
||||
virtual void visit(const IdmapHeader& header);
|
||||
virtual void visit(const IdmapData& data);
|
||||
virtual void visit(const IdmapData::Header& header);
|
||||
virtual void visit(const IdmapData::TypeEntry& type_entry);
|
||||
~BinaryStreamVisitor() override = default;
|
||||
void visit(const Idmap& idmap) override;
|
||||
void visit(const IdmapHeader& header) override;
|
||||
void visit(const IdmapData& data) override;
|
||||
void visit(const IdmapData::Header& header) override;
|
||||
void visit(const IdmapData::TypeEntry& type_entry) override;
|
||||
|
||||
private:
|
||||
void Write16(uint16_t value);
|
||||
|
||||
@@ -33,11 +33,12 @@ class PrettyPrintVisitor : public Visitor {
|
||||
public:
|
||||
explicit PrettyPrintVisitor(std::ostream& stream) : stream_(stream) {
|
||||
}
|
||||
virtual void visit(const Idmap& idmap);
|
||||
virtual void visit(const IdmapHeader& header);
|
||||
virtual void visit(const IdmapData& data);
|
||||
virtual void visit(const IdmapData::Header& header);
|
||||
virtual void visit(const IdmapData::TypeEntry& type_entry);
|
||||
~PrettyPrintVisitor() override = default;
|
||||
void visit(const Idmap& idmap) override;
|
||||
void visit(const IdmapHeader& header) override;
|
||||
void visit(const IdmapData& data) override;
|
||||
void visit(const IdmapData::Header& header) override;
|
||||
void visit(const IdmapData::TypeEntry& type_entry) override;
|
||||
|
||||
private:
|
||||
std::ostream& stream_;
|
||||
|
||||
@@ -34,11 +34,12 @@ class RawPrintVisitor : public Visitor {
|
||||
public:
|
||||
explicit RawPrintVisitor(std::ostream& stream) : stream_(stream), offset_(0) {
|
||||
}
|
||||
virtual void visit(const Idmap& idmap);
|
||||
virtual void visit(const IdmapHeader& header);
|
||||
virtual void visit(const IdmapData& data);
|
||||
virtual void visit(const IdmapData::Header& header);
|
||||
virtual void visit(const IdmapData::TypeEntry& type_entry);
|
||||
~RawPrintVisitor() override = default;
|
||||
void visit(const Idmap& idmap) override;
|
||||
void visit(const IdmapHeader& header) override;
|
||||
void visit(const IdmapData& data) override;
|
||||
void visit(const IdmapData::Header& header) override;
|
||||
void visit(const IdmapData::TypeEntry& type_entry) override;
|
||||
|
||||
private:
|
||||
void print(uint16_t value, const char* fmt, ...);
|
||||
|
||||
@@ -123,7 +123,7 @@ std::string GetTestDataPath();
|
||||
|
||||
class Idmap2Tests : public testing::Test {
|
||||
protected:
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
#ifdef __ANDROID__
|
||||
tmp_dir_path_ = "/data/local/tmp/idmap2-tests-XXXXXX";
|
||||
#else
|
||||
@@ -136,7 +136,7 @@ class Idmap2Tests : public testing::Test {
|
||||
idmap_path_ = tmp_dir_path_ + "/a.idmap";
|
||||
}
|
||||
|
||||
virtual void TearDown() {
|
||||
void TearDown() override {
|
||||
EXPECT_EQ(rmdir(tmp_dir_path_.c_str()), 0)
|
||||
<< "Failed to remove temporary directory " << tmp_dir_path_ << ": " << strerror(errno);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user