Stay organized with collections Save and categorize content based on your preferences.

TestDevice.MicrodroidBuilder

public static class TestDevice.MicrodroidBuilder
extends Object

java.lang.Object
   ↳ com.android.tradefed.device.TestDevice.MicrodroidBuilder


A builder used to create a Microdroid TestDevice.

Summary

Public methods

TestDevice.MicrodroidBuilder addExtraIdsigPath(String extraIdsigPath)

Adds extra idsig file to the list.

ITestDevice build(TestDevice device)

Starts a Micrdroid TestDevice on the given TestDevice.

TestDevice.MicrodroidBuilder cpuAffinity(String affinity)

Sets on which host CPUs the vCPUs can run.

TestDevice.MicrodroidBuilder debugLevel(String debugLevel)

Sets the debug level.

static TestDevice.MicrodroidBuilder fromDevicePath(String apkPath, String configPath)

Creates a Microdroid builder for the given apkPath and the payload config file in APK.

static TestDevice.MicrodroidBuilder fromFile(File apkFile, String configPath)

Creates a Microdroid builder for the given APK and the payload config file in APK.

TestDevice.MicrodroidBuilder memoryMib(int memoryMib)

Sets the amount of RAM to give the VM.

TestDevice.MicrodroidBuilder numCpus(int num)

Sets the number of vCPUs in the VM.

TestDevice.MicrodroidBuilder protectedVm(boolean isProtectedVm)

Sets whether the VM will be protected or not.

Public methods

addExtraIdsigPath

public TestDevice.MicrodroidBuilder addExtraIdsigPath (String extraIdsigPath)

Adds extra idsig file to the list.

Parameters
extraIdsigPath String

Returns
TestDevice.MicrodroidBuilder

build

public ITestDevice build (TestDevice device)

Starts a Micrdroid TestDevice on the given TestDevice.

Parameters
device TestDevice

Returns
ITestDevice

Throws
DeviceNotAvailableException

cpuAffinity

public TestDevice.MicrodroidBuilder cpuAffinity (String affinity)

Sets on which host CPUs the vCPUs can run. The format is a comma-separated list of CPUs or CPU ranges to run vCPUs on. e.g. "0,1-3,5" to choose host CPUs 0, 1, 2, 3, and 5. Or this can be a colon-separated list of assignments of vCPU to host CPU assignments. e.g. "0=0:1=1:2=2" to map vCPU 0 to host CPU 0, and so on.

Parameters
affinity String

Returns
TestDevice.MicrodroidBuilder

debugLevel

public TestDevice.MicrodroidBuilder debugLevel (String debugLevel)

Sets the debug level. Supported values: "none", "app_only", and "full".

Parameters
debugLevel String

Returns
TestDevice.MicrodroidBuilder

fromDevicePath

public static TestDevice.MicrodroidBuilder fromDevicePath (String apkPath, 
                String configPath)

Creates a Microdroid builder for the given apkPath and the payload config file in APK.

Parameters
apkPath String

configPath String

Returns
TestDevice.MicrodroidBuilder

fromFile

public static TestDevice.MicrodroidBuilder fromFile (File apkFile, 
                String configPath)

Creates a Microdroid builder for the given APK and the payload config file in APK.

Parameters
apkFile File

configPath String

Returns
TestDevice.MicrodroidBuilder

memoryMib

public TestDevice.MicrodroidBuilder memoryMib (int memoryMib)

Sets the amount of RAM to give the VM. If this is zero or negative then the default will be used.

Parameters
memoryMib int

Returns
TestDevice.MicrodroidBuilder

numCpus

public TestDevice.MicrodroidBuilder numCpus (int num)

Sets the number of vCPUs in the VM. Defaults to 1.

Parameters
num int

Returns
TestDevice.MicrodroidBuilder

protectedVm

public TestDevice.MicrodroidBuilder protectedVm (boolean isProtectedVm)

Sets whether the VM will be protected or not.

Parameters
isProtectedVm boolean

Returns
TestDevice.MicrodroidBuilder