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)

ติดตั้ง APK ของยูทิลิตีบัญชีที่อยู่ใน JAR หากจำเป็น

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)

ถอนการติดตั้ง APK ของยูทิลิตีบัญชีที่อยู่ใน JAR

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: รหัสของผู้ใช้ที่จะเพิ่มบัญชี

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: รหัสผู้ใช้ที่จะตรวจสอบ

คิกรีเทิร์น
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)

ติดตั้ง APK ของยูทิลิตีบัญชีที่อยู่ใน JAR หากจำเป็น

พารามิเตอร์
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 จริง หากนำออกสำเร็จ หรือเป็นเท็จ

การขว้าง
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

removeAllAccountAttempt

public static boolean removeAllAccountAttempt (ITestDevice device, 
                int userId)

นำบัญชีทั้งหมดออกจากอุปกรณ์

คิกรีเทิร์น
boolean จริง หากนำออกสำเร็จ หรือเป็นเท็จ

การขว้าง
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: รหัสของผู้ใช้ที่จะเรียกใช้การดำเนินการนี้

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 ที่ระบุ Assume syncing is false;

พารามิเตอร์
device ITestDevice: ITestDevice

userId int: รหัสของผู้ใช้ที่จะเรียกใช้การดำเนินการนี้

accountName String: ชื่อเต็มของบัญชี Google ที่จะเปิดการซิงค์

คิกรีเทิร์น
boolean true หากปิดการซิงค์สำเร็จ

การขว้าง
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

uninstallUtil

public static boolean uninstallUtil (ITestDevice device)

ถอนการติดตั้ง APK ของยูทิลิตีบัญชีที่อยู่ใน JAR

พารามิเตอร์
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