GoogleAccountPreparer

public class GoogleAccountPreparer
extends WaitForDeviceDatetimePreparer

java.lang.Object
   ↳ com.android.tradefed.targetprep.BaseTargetPreparer
     ↳ com.android.tradefed.targetprep.WaitForDeviceDatetimePreparer
       ↳ com.google.android.tradefed.targetprep.GoogleAccountPreparer


A ITargetPreparer that supports configuring google accounts. If no account is specified and gaia account creation is enable, then a gaia account will be created and added to the device.

Summary

Public constructors

GoogleAccountPreparer()

Public methods

void setAccount(String accountName, String accountPassword)

Sets the Google account to create.

void setAccountSync(boolean value)

Sets whether to enable sync on the account

void setSyncThenOff(long syncThenOff)

Sets whether to enable sync on the account

void setUp(TestInformation testInfo)

void setWaitForCheckin(boolean value)

Sets whether to wait for checkin to complete after adding account

void tearDown(TestInformation testInfo, Throwable e)

Protected methods

getAccountBlacklist()
String getAccountName()
String getAccountPassword()
int getAccountRangeEnd()
int getAccountRangeStart()
File getCredentialFile()
boolean getUseAccountRange()
JSONObject loadCredentialsFromFile(File file)
void processCredentialFile(IBuildInfo buildInfo)
File resolveRelativeFilePath(IBuildInfo buildInfo, String fileName)
void setCredentialFile(File file)

Public constructors

GoogleAccountPreparer

public GoogleAccountPreparer ()

Public methods

setAccount

public void setAccount (String accountName, 
                String accountPassword)

Sets the Google account to create.

Parameters
accountName String

accountPassword String

setAccountSync

public void setAccountSync (boolean value)

Sets whether to enable sync on the account

Parameters
value boolean

setSyncThenOff

public void setSyncThenOff (long syncThenOff)

Sets whether to enable sync on the account

Parameters
syncThenOff long

setUp

public void setUp (TestInformation testInfo)

Parameters
testInfo TestInformation

Throws
BuildError
DeviceNotAvailableException
TargetSetupError

setWaitForCheckin

public void setWaitForCheckin (boolean value)

Sets whether to wait for checkin to complete after adding account

Parameters
value boolean

tearDown

public void tearDown (TestInformation testInfo, 
                Throwable e)

Parameters
testInfo TestInformation

e Throwable

Throws
DeviceNotAvailableException

Protected methods

getAccountBlacklist

protected  getAccountBlacklist ()

Returns

getAccountName

protected String getAccountName ()

Returns
String

getAccountPassword

protected String getAccountPassword ()

Returns
String

getAccountRangeEnd

protected int getAccountRangeEnd ()

Returns
int

getAccountRangeStart

protected int getAccountRangeStart ()

Returns
int

getCredentialFile

protected File getCredentialFile ()

Returns
File

getUseAccountRange

protected boolean getUseAccountRange ()

Returns
boolean

loadCredentialsFromFile

protected JSONObject loadCredentialsFromFile (File file)

Parameters
file File

Returns
JSONObject

Throws
TargetSetupError

processCredentialFile

protected void processCredentialFile (IBuildInfo buildInfo)

Parameters
buildInfo IBuildInfo

Throws
TargetSetupError

resolveRelativeFilePath

protected File resolveRelativeFilePath (IBuildInfo buildInfo, 
                String fileName)

Parameters
buildInfo IBuildInfo

fileName String

Returns
File

Throws
TargetSetupError

setCredentialFile

protected void setCredentialFile (File file)

Parameters
file File