Fix getActiveApexInfos for ApexManagerFlattenedApex

The for loop in existing code is redundant. It is supposed to filter out
some items when generating result.

Bug: 161150361
Test: m OVERRIDE_TARGET_FLATTEN_APEX=true
Test: atest ApexManagerTest
Change-Id: I0ff04b2b500f555ae6e34b9c87b7dc57e3bccaf3
This commit is contained in:
Mohammad Samiul Islam
2020-07-13 20:10:49 +01:00
parent b28e95e648
commit 56c6ba3917

View File

@@ -1023,12 +1023,17 @@ public abstract class ApexManager {
if (files != null) {
for (File file : files) {
if (file.isDirectory() && !file.getName().contains("@")) {
boolean skip = false;
for (String skipDir : skipDirs) {
if (file.getName().equals(skipDir)) {
continue;
skip = true;
break;
}
}
result.add(new ActiveApexInfo(file, Environment.getRootDirectory()));
if (!skip) {
result.add(
new ActiveApexInfo(file, Environment.getRootDirectory()));
}
}
}
}