am 899daf75: am d7e89906: Update platformDir search in tests. [DO NOT MERGE]

* commit '899daf759e02bef0de14dc1a14b96b4d71f0b9fc':
  Update platformDir search in tests. [DO NOT MERGE]
This commit is contained in:
Deepanshu Gupta
2015-08-26 20:18:15 +00:00
committed by Android Git Automerger

View File

@@ -124,9 +124,14 @@ public class Main {
if (platformDir != null) {
return platformDir;
}
// Test if workingDir is platform/frameworks/base/tools/layoutlib. That is, root should be
// workingDir/../../../../ (4 levels up)
// Test if workingDir is platform/frameworks/base/tools/layoutlib/bridge.
File currentDir = workingDir;
if (currentDir.getName().equalsIgnoreCase("bridge")) {
currentDir = currentDir.getParentFile();
}
// Test if currentDir is platform/frameworks/base/tools/layoutlib. That is, root should be
// workingDir/../../../../ (4 levels up)
for (int i = 0; i < 4; i++) {
if (currentDir != null) {
currentDir = currentDir.getParentFile();