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

* commit 'd7e89906a453a562a8fef303fc6c4068dfa5c0d0':
  Update platformDir search in tests. [DO NOT MERGE]
This commit is contained in:
Deepanshu Gupta
2015-08-26 05:54:58 +00:00
committed by Android Git Automerger

View File

@@ -124,9 +124,14 @@ public class Main {
if (platformDir != null) { if (platformDir != null) {
return platformDir; 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; 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++) { for (int i = 0; i < 4; i++) {
if (currentDir != null) { if (currentDir != null) {
currentDir = currentDir.getParentFile(); currentDir = currentDir.getParentFile();