Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d00d143f authored by Deepanshu Gupta's avatar Deepanshu Gupta Committed by Android Git Automerger
Browse files

am f45420d0: am 565b6b41: Merge "Update platform.dir search in tests." into...

am f45420d0: am 565b6b41: Merge "Update platform.dir search in tests." into lmp-mr1-dev automerge: 7e393853

* commit 'f45420d0':
  Update platform.dir search in tests.
parents 6fe38072 f45420d0
Loading
Loading
Loading
Loading
+18 −2
Original line number Diff line number Diff line
@@ -165,11 +165,27 @@ public class Main {
        if (!out.isDirectory()) {
            return null;
        }
        File sdkDir = new File(out, "sdk" + File.separator + "sdk");
        File sdkDir = new File(out, "sdk");
        if (!sdkDir.isDirectory()) {
            // The directory we thought that should contain the sdk is not a directory.
            return null;
        }
        File[] sdkDirs = sdkDir.listFiles(new FileFilter() {
            @Override
            public boolean accept(File path) {
                // We need to search for $TARGET_PRODUCT (usually, sdk_phone_armv7)
                return path.isDirectory() && path.getName().startsWith("sdk");
            }
        });
        for (File dir : sdkDirs) {
            String platformDir = getPlatformDirFromHostOutSdkSdk(dir);
            if (platformDir != null) {
                return platformDir;
            }
        }
        return null;
    }

    private static String getPlatformDirFromHostOutSdkSdk(File sdkDir) {
        File[] possibleSdks = sdkDir.listFiles(new FileFilter() {
            @Override
            public boolean accept(File path) {