Google is committed to advancing racial equity for Black communities. See how.

SystemUtil

public class SystemUtil
extends Object

java.lang.Object
   ↳ com.android.tradefed.util.SystemUtil


Utility class for making system calls.

Summary

Nested classes

enum SystemUtil.EnvVariable

 

Fields

public static final ENV_VARIABLE_PATHS_IN_TESTS_DIR

Keep track of the mapping of the variables to the subpath it takes in the tests dir.

public static final String REMOTE_VM_VARIABLE

Public constructors

SystemUtil()

Public methods

static File getExternalTestCasesDir(SystemUtil.EnvVariable envVariable)

Get the file associated with the env.

static getExternalTestCasesDirs()

Get a list of ERROR(/File) pointing to tests directories external to Tradefed.

static File getProductOutputDir()

Gets the product specific output dir from an Android build tree.

static File getRunningJavaBinaryPath()

Returns the path to the Java binary that current test harness is running in

static getTestCasesDirs(IBuildInfo buildInfo)

Get a list of ERROR(/File) of the test cases directories

static boolean isRemoteEnvironment()

Return true if we are currently running in a remote environment.

Fields

ENV_VARIABLE_PATHS_IN_TESTS_DIR

public static final  ENV_VARIABLE_PATHS_IN_TESTS_DIR

Keep track of the mapping of the variables to the subpath it takes in the tests dir.

REMOTE_VM_VARIABLE

public static final String REMOTE_VM_VARIABLE

Public constructors

SystemUtil

public SystemUtil ()

Public methods

getExternalTestCasesDir

public static File getExternalTestCasesDir (SystemUtil.EnvVariable envVariable)

Get the file associated with the env. variable.

Parameters
envVariable SystemUtil.EnvVariable: ANDROID_TARGET_OUT_TESTCASES or ANDROID_HOST_OUT_TESTCASES

Returns
File The directory associated.

getExternalTestCasesDirs

public static  getExternalTestCasesDirs ()

Get a list of ERROR(/File) pointing to tests directories external to Tradefed.

Returns

getProductOutputDir

public static File getProductOutputDir ()

Gets the product specific output dir from an Android build tree. Typically this location contains images for various device partitions, bootloader, radio and so on.

Note: the method does not guarantee that this path exists.

Returns
File the location of the output dir or null if the current build is not

getRunningJavaBinaryPath

public static File getRunningJavaBinaryPath ()

Returns the path to the Java binary that current test harness is running in

Returns
File

getTestCasesDirs

public static  getTestCasesDirs (IBuildInfo buildInfo)

Get a list of ERROR(/File) of the test cases directories

Parameters
buildInfo IBuildInfo: the build artifact information. Set it to null if build info is not available or there is no need to get test cases directories from build info.

Returns
a list of ERROR(/File) of directories of the test cases folder of build output, based on the value of environment variables and the given build info.

isRemoteEnvironment

public static boolean isRemoteEnvironment ()

Return true if we are currently running in a remote environment.

Returns
boolean