ManagedTestDeviceFactory

public class ManagedTestDeviceFactory
extends Object implements IManagedTestDeviceFactory

java.lang.Object
   ↳ com.android.tradefed.device.ManagedTestDeviceFactory


Factory untuk membuat berbagai jenis perangkat yang dapat dipantau oleh Tf

Ringkasan

Konstanta

String CHECK_PM_CMD

String EXPECTED_ERROR

String EXPECTED_RES

int FRAMEWORK_CHECK_MAX_RETRY

long FRAMEWORK_CHECK_SLEEP_MS

String IPADDRESS_PATTERN

String NOTIFY_AS_NATIVE

Kolom

protected IDeviceMonitor mAllocationMonitor

protected IDeviceManager mDeviceManager

protected boolean mFastbootEnabled

Konstruktor publik

ManagedTestDeviceFactory(boolean fastbootEnabled, IDeviceManager deviceManager, IDeviceMonitor allocationMonitor)

Metode publik

IManagedTestDevice createDevice(IDevice idevice)

Buat IManagedTestDevice berdasarkan IDevice yang diteruskan ke IManagedTestDevice tersebut.

IManagedTestDevice createRequestedDevice(IDevice idevice, IDeviceSelection options)

Membuat perangkat yang cocok dengan spesifikasi secara khusus

static boolean isTcpDeviceSerial(String serial)

Helper ke perangkat jika berupa serial dari perangkat yang terhubung dari jarak jauh.

void setFastbootEnabled(boolean enable)

Mengaktifkan atau tidak mengaktifkan dukungan fastboot untuk perangkat yang dibuat.

Metode yang dilindungi

CollectingOutputReceiver createOutputReceiver()

Buat CollectingOutputReceiver.

IRunUtil getRunUtil()

Menampilkan instance IRunUtil default.

boolean isRemoteEnvironment()

Menampilkan benar jika saat ini kita berjalan di lingkungan jarak jauh.

Konstanta

CHECK_PM_CMD

protected static final String CHECK_PM_CMD

Nilai Konstanta: "ls %s"

EXPECTED_ERROR

protected static final String EXPECTED_ERROR

Nilai Konstanta: "Tidak ada file atau direktori tersebut"

EXPECTED_RES

protected static final String EXPECTED_RES

Nilai Konstanta: "/system/bin/pm"

FRAMEWORK_CHECK_MAX_RETRY

protected static final int FRAMEWORK_CHECK_MAX_RETRY

Nilai Konstanta: 3 (0x00000003)

FRAMEWORK_CHECK_SLEEP_MS

protected static final long FRAMEWORK_CHECK_SLEEP_MS

Nilai Konstanta: 500 (0x00000000000001f4)

IPADDRESS_PATTERN

public static final String IPADDRESS_PATTERN

Nilai Konstanta: "((^([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5]))|(localhost)){1}"

NOTIFY_AS_NATIVE

public static final String NOTIFY_AS_NATIVE

Nilai Konstanta: "NOTIFY_AS_NATIVE"

Kolom

mAllocationMonitor

protected IDeviceMonitor mAllocationMonitor

mDeviceManager

protected IDeviceManager mDeviceManager

mFastbootEnabled

protected boolean mFastbootEnabled

Konstruktor publik

ManagedTestDeviceFactory

public ManagedTestDeviceFactory (boolean fastbootEnabled, 
                IDeviceManager deviceManager, 
                IDeviceMonitor allocationMonitor)

Parameter
fastbootEnabled boolean

deviceManager IDeviceManager

allocationMonitor IDeviceMonitor

Metode publik

createDevice

public IManagedTestDevice createDevice (IDevice idevice)

Buat IManagedTestDevice berdasarkan IDevice yang diteruskan ke IManagedTestDevice tersebut.

Parameter
idevice IDevice: yang akan menentukan jenis perangkat yang dibuat

Hasil
IManagedTestDevice IManagedTestDevice yang dibuat berdasarkan IDevice

createRequestedDevice

public IManagedTestDevice createRequestedDevice (IDevice idevice, 
                IDeviceSelection options)

Membuat perangkat yang cocok dengan spesifikasi secara khusus

Parameter
idevice IDevice

options IDeviceSelection

Hasil
IManagedTestDevice

isTcpDeviceSerial

public static boolean isTcpDeviceSerial (String serial)

Helper ke perangkat jika berupa serial dari perangkat yang terhubung dari jarak jauh. Format serial perangkat tcp adalah :

Parameter
serial String

Hasil
boolean

setFastbootEnabled

public void setFastbootEnabled (boolean enable)

Mengaktifkan atau tidak mengaktifkan dukungan fastboot untuk perangkat yang dibuat.

Parameter
enable boolean: nilai yang ditetapkan dukungan.

Metode yang dilindungi

createOutputReceiver

protected CollectingOutputReceiver createOutputReceiver ()

Buat CollectingOutputReceiver.

Hasil
CollectingOutputReceiver

getRunUtil

protected IRunUtil getRunUtil ()

Menampilkan instance IRunUtil default.

Hasil
IRunUtil

isRemoteEnvironment

protected boolean isRemoteEnvironment ()

Menampilkan benar jika saat ini kita berjalan di lingkungan jarak jauh. Tindakan ini akan mengubah perilaku perangkat.

Hasil
boolean