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