GoogleAccountUtil

public class GoogleAccountUtil
extends Object

java.lang.Object
   ↳ com.google.android.tradefed.util.GoogleAccountUtil


기기에서 Google 계정 구성을 지원하는 유틸리티

요약

상수

String ACCOUNT_PKG_NAME

String UTIL_APK_NAME

필드

public static final String CHECK_INSTRUMENTATION_CMD

공개 생성자

GoogleAccountUtil()

공개 메서드

static boolean addAccountAttempt(ITestDevice device, int userId, String accountName, String password, boolean sync, boolean waitForCheckin)

주어진 Google 계정으로 테스트 대상 기기를 구성하려고 시도합니다.

static boolean hasAccount(ITestDevice device, int userId)

기기에 계정이 있는지 확인합니다.

static boolean installUtil(ITestDevice device)
static boolean installUtil(ITestDevice device, File altApk)

필요한 경우 jar에 포함된 계정 유틸리티 APK 설치

static boolean isAccountUtilInstalled(ITestDevice device)

계정 유틸리티가 현재 설치되어 있는지 확인

static boolean removeAccountAttempt(ITestDevice device, int userId, String accountName)

지정된 단일 계정 삭제

static boolean removeAllAccountAttempt(ITestDevice device, int userId)

기기의 모든 계정 삭제

static boolean syncAndOff(ITestDevice device, int userId, String accountName, long syncThenOff)

지정된 Google 계정과의 동기화를 사용 중지합니다.

static boolean syncOn(ITestDevice device, int userId, String accountName)

지정된 Google 계정과의 동기화를 사용 설정합니다.

static boolean uninstallUtil(ITestDevice device)

jar에 포함된 계정 유틸리티 apk를 제거합니다.

static boolean waitForAccountSync(ITestDevice device, int userId, long interval, long timeout, boolean forceSync)

기기의 동기화가 완료될 때까지 기다립니다.

상수

ACCOUNT_PKG_NAME

public static final String ACCOUNT_PKG_NAME

상수 값: "com.google.android.tradefed.account"

UTIL_APK_NAME

public static final String UTIL_APK_NAME

상수 값: 'GoogleAccountUtil'

필드

CHECK_INSTRUMENTATION_CMD

public static final String CHECK_INSTRUMENTATION_CMD

공개 생성자

GoogleAccountUtil

public GoogleAccountUtil ()

공개 메서드

addAccountAttempt

public static boolean addAccountAttempt (ITestDevice device, 
                int userId, 
                String accountName, 
                String password, 
                boolean sync, 
                boolean waitForCheckin)

주어진 Google 계정으로 테스트 대상 기기를 구성하려고 시도합니다.

계정이 서버에 이미 있어야 합니다.

단위 테스트를 위해 노출되었습니다.

매개변수
device ITestDevice: ITestDevice

userId int: 계정이 추가될 사용자의 ID

accountName String: 추가할 Google 계정의 전체 이름

password String: 계정 비밀번호

sync boolean: 이 계정에 자동 동기화를 사용 설정해야 하는 경우 true

waitForCheckin boolean: 계정 추가 후 체크인을 기다리는 true

반환 값
boolean 계정이 생성되면 true, 그렇지 않으면 false

생성 값
DeviceNotAvailableException

hasAccount

public static boolean hasAccount (ITestDevice device, 
                int userId)

기기에 계정이 있는지 확인합니다.

매개변수
device ITestDevice: 계정에 대해 확인된 ITestDevice

userId int: 확인할 사용자 ID

반환 값
boolean

생성 값
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

installUtil

public static boolean installUtil (ITestDevice device)

매개변수
device ITestDevice

반환 값
boolean

생성 값
DeviceNotAvailableException

installUtil

public static boolean installUtil (ITestDevice device, 
                File altApk)

필요한 경우 jar에 포함된 계정 유틸리티 APK 설치

매개변수
device ITestDevice: 유틸리티를 설치할 위치입니다.

altApk File

반환 값
boolean

생성 값
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

isAccountUtilInstalled

public static boolean isAccountUtilInstalled (ITestDevice device)

계정 유틸리티가 현재 설치되어 있는지 확인

매개변수
device ITestDevice: 계정 유틸리티가 설치되어 있는지 확인할 위치

반환 값
boolean

생성 값
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

removeAccountAttempt

public static boolean removeAccountAttempt (ITestDevice device, 
                int userId, 
                String accountName)

지정된 단일 계정 삭제

매개변수
accountName String

반환 값
boolean 삭제가 성공하면 true, 그렇지 않으면 false입니다.

생성 값
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

removeAllAccountAttempt

public static boolean removeAllAccountAttempt (ITestDevice device, 
                int userId)

기기의 모든 계정 삭제

반환 값
boolean 삭제가 성공하면 true, 그렇지 않으면 false입니다.

생성 값
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

syncAndOff

public static boolean syncAndOff (ITestDevice device, 
                int userId, 
                String accountName, 
                long syncThenOff)

지정된 Google 계정과의 동기화를 사용 중지합니다. 동기화가 사용 설정되어 있다고 가정합니다.

매개변수
device ITestDevice: ITestDevice

userId int: 이 작업을 실행할 사용자의 ID

accountName String: 동기화를 사용 중지할 Google 계정의 전체 이름

syncThenOff long: 동기화가 실행되도록 허용되는 시간(초)입니다.

반환 값
boolean 동기화가 사용 중지된 경우 true

생성 값
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

syncOn

public static boolean syncOn (ITestDevice device, 
                int userId, 
                String accountName)

지정된 Google 계정과의 동기화를 사용 설정합니다. 동기화가 false라고 가정합니다.

매개변수
device ITestDevice: ITestDevice

userId int: 이 작업을 실행할 사용자의 ID

accountName String: 동기화를 사용 설정할 Google 계정의 전체 이름

반환 값
boolean 동기화가 사용 중지된 경우 true

생성 값
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

uninstallUtil

public static boolean uninstallUtil (ITestDevice device)

jar에 포함된 계정 유틸리티 apk를 제거합니다.

매개변수
device ITestDevice: 계정 유틸리티를 제거할 위치입니다.

반환 값
boolean

생성 값
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

waitForAccountSync

public static boolean waitForAccountSync (ITestDevice device, 
                int userId, 
                long interval, 
                long timeout, 
                boolean forceSync)

기기의 동기화가 완료될 때까지 기다립니다.

매개변수
device ITestDevice

userId int

interval long

timeout long

forceSync boolean

반환 값
boolean

생성 값
DeviceNotAvailableException