Merge "Treating all FileSection files as device specific."
am: db2353c143
Change-Id: Ifc8d046ada24e83b6f68d56747e96c3d2db6f3e8
This commit is contained in:
@@ -255,7 +255,9 @@ status_t FileSection::Execute(ReportRequestSet* requests) const {
|
|||||||
unique_fd fd(open(mFilename, O_RDONLY | O_CLOEXEC));
|
unique_fd fd(open(mFilename, O_RDONLY | O_CLOEXEC));
|
||||||
if (fd.get() == -1) {
|
if (fd.get() == -1) {
|
||||||
ALOGW("FileSection '%s' failed to open file", this->name.string());
|
ALOGW("FileSection '%s' failed to open file", this->name.string());
|
||||||
return this->deviceSpecific ? NO_ERROR : -errno;
|
// There may be some devices/architectures that won't have the file.
|
||||||
|
// Just return here without an error.
|
||||||
|
return NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
FdBuffer buffer;
|
FdBuffer buffer;
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ TEST_F(SectionTest, FileSection) {
|
|||||||
|
|
||||||
TEST_F(SectionTest, FileSectionNotExist) {
|
TEST_F(SectionTest, FileSectionNotExist) {
|
||||||
FileSection fs1(NOOP_PARSER, "notexist", false, QUICK_TIMEOUT_MS);
|
FileSection fs1(NOOP_PARSER, "notexist", false, QUICK_TIMEOUT_MS);
|
||||||
ASSERT_EQ(NAME_NOT_FOUND, fs1.Execute(&requests));
|
ASSERT_EQ(NO_ERROR, fs1.Execute(&requests));
|
||||||
|
|
||||||
FileSection fs2(NOOP_PARSER, "notexist", true, QUICK_TIMEOUT_MS);
|
FileSection fs2(NOOP_PARSER, "notexist", true, QUICK_TIMEOUT_MS);
|
||||||
ASSERT_EQ(NO_ERROR, fs2.Execute(&requests));
|
ASSERT_EQ(NO_ERROR, fs2.Execute(&requests));
|
||||||
|
|||||||
Reference in New Issue
Block a user