UserHelper

public final class UserHelper
extends Object

java.lang.Object
com.android.tradefed.targetprep.UserHelper


Riepilogo

Costanti

String RUN_TESTS_AS_USER_KEY

Proprietà di sistema utilizzata per indicare quale utente Android esegue il test.

Metodi pubblici

static int createUser(ITestDevice device, boolean reuseTestUser)

Crea un nuovo utente secondario o riutilizza uno esistente, se applicabile.

static int createUser(ITestDevice device, boolean reuseTestUser, String userName)

Crea un nuovo utente secondario o riutilizza uno esistente, se applicabile.

static int getRunTestsAsUser(TestInformation testInfo)

Recupera l'ID utente per eseguire i test, dalla proprietà RUN_TESTS_AS_USER_KEY.

Costanti

RUN_TESTS_AS_USER_KEY

public static final String RUN_TESTS_AS_USER_KEY

Proprietà di sistema utilizzata per indicare quale utente Android esegue il test.

Valore costante: "RUN_TESTS_AS_USER"

Metodi pubblici

createUser

public static int createUser (ITestDevice device, 
                boolean reuseTestUser)

Crea un nuovo utente secondario o riutilizza uno esistente, se applicabile.

Parametri
device ITestDevice

reuseTestUser boolean

Resi
int

Genera
DeviceNotAvailableException
TargetSetupError

createUser

public static int createUser (ITestDevice device, 
                boolean reuseTestUser, 
                String userName)

Crea un nuovo utente secondario o riutilizza uno esistente, se applicabile.

Parametri
device ITestDevice

reuseTestUser boolean

userName String

Resi
int

Genera
DeviceNotAvailableException
TargetSetupError

getRunTestsAsUser

public static int getRunTestsAsUser (TestInformation testInfo)

Recupera l'ID utente per eseguire i test, dalla proprietà RUN_TESTS_AS_USER_KEY.

Se la proprietà non è impostata o non è valida, restituisce l'utente corrente.

Parametri
testInfo TestInformation

Resi
int

Genera
DeviceNotAvailableException