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


支持配置 Google 账号的 ITargetPreparer。如果未指定账号且启用了 Gaia 账号创建,则系统会创建 Gaia 账号并将其添加到设备。

摘要

公共构造函数

GoogleAccountPreparer()

公共方法

void setAccount(String accountName, String accountPassword)

设置要创建的 Google 账号。

void setAccountSync(boolean value)

设置是否在账号上启用同步

void setSyncThenOff(long syncThenOff)

设置是否在账号上启用同步

void setUp(TestInformation testInfo)

void setWaitForCheckin(boolean value)

设置在添加账号后是否等待签入完成

void tearDown(TestInformation testInfo, Throwable e)

受保护的方法

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)

公共构造函数

GoogleAccountPreparer

public GoogleAccountPreparer ()

公共方法

setAccount

public void setAccount (String accountName, 
                String accountPassword)

设置要创建的 Google 账号。

参数
accountName String

accountPassword String

setAccountSync

public void setAccountSync (boolean value)

设置是否在账号上启用同步

参数
value boolean

setSyncThenOff

public void setSyncThenOff (long syncThenOff)

设置是否在账号上启用同步

参数
syncThenOff long

setUp

public void setUp (TestInformation testInfo)

参数
testInfo TestInformation

抛出
BuildError
DeviceNotAvailableException
TargetSetupError

setWaitForCheckin

public void setWaitForCheckin (boolean value)

设置在添加账号后是否等待签入完成

参数
value boolean

tearDown

public void tearDown (TestInformation testInfo, 
                Throwable e)

参数
testInfo TestInformation

e Throwable

抛出
DeviceNotAvailableException

受保护的方法

getAccountBlacklist

protected  getAccountBlacklist ()

返回

getAccountName

protected String getAccountName ()

返回
String

getAccountPassword

protected String getAccountPassword ()

返回
String

getAccountRangeEnd

protected int getAccountRangeEnd ()

返回
int

getAccountRangeStart

protected int getAccountRangeStart ()

返回
int

getCredentialFile

protected File getCredentialFile ()

返回
File

getUseAccountRange

protected boolean getUseAccountRange ()

返回
boolean

loadCredentialsFromFile

protected JSONObject loadCredentialsFromFile (File file)

参数
file File

返回
JSONObject

抛出
TargetSetupError

processCredentialFile

protected void processCredentialFile (IBuildInfo buildInfo)

参数
buildInfo IBuildInfo

抛出
TargetSetupError

resolveRelativeFilePath

protected File resolveRelativeFilePath (IBuildInfo buildInfo, 
                String fileName)

参数
buildInfo IBuildInfo

fileName String

返回
File

抛出
TargetSetupError

setCredentialFile

protected void setCredentialFile (File file)

参数
file File