GoogleAccountUtil

public class GoogleAccountUtil
extends Object

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


Utilitas yang mendukung konfigurasi akun Google di perangkat

Ringkasan

Konstanta

String ACCOUNT_PKG_NAME

String UTIL_APK_NAME

Kolom

public static final String CHECK_INSTRUMENTATION_CMD

Konstruktor publik

GoogleAccountUtil()

Metode publik

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

Mencoba mengonfigurasi perangkat yang sedang diuji dengan Akun Google tertentu.

static boolean hasAccount(ITestDevice device, int userId)

Periksa apakah ada akun di perangkat.

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

Instal APK utilitas akun yang ada dalam jar jika perlu

static boolean isAccountUtilInstalled(ITestDevice device)

Memeriksa apakah utilitas akun saat ini sudah diinstal

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

Menghapus satu akun yang ditentukan

static boolean removeAllAccountAttempt(ITestDevice device, int userId)

Menghapus semua akun dari perangkat

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

Menonaktifkan sinkronisasi dengan Akun Google yang ditentukan.

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

Mengaktifkan sinkronisasi dengan Akun Google yang ditentukan.

static boolean uninstallUtil(ITestDevice device)

Meng-uninstal APK utilitas akun yang ada dalam JAR

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

Tunggu hingga perangkat selesai menyinkronkan.

Konstanta

ACCOUNT_PKG_NAME

public static final String ACCOUNT_PKG_NAME

Nilai Konstanta: "com.google.android.tradefed.account"

UTIL_APK_NAME

public static final String UTIL_APK_NAME

Nilai Konstanta: "GoogleAccountUtil"

Kolom

CHECK_INSTRUMENTATION_CMD

public static final String CHECK_INSTRUMENTATION_CMD

Konstruktor publik

GoogleAccountUtil

public GoogleAccountUtil ()

Metode publik

addAccountAttempt

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

Mencoba mengonfigurasi perangkat yang sedang diuji dengan Akun Google tertentu.

Akun harus sudah ada di server.

Diekspos untuk pengujian unit.

Parameter
device ITestDevice: ITestDevice

userId int: ID pengguna yang akan ditambahkan ke akun

accountName String: nama lengkap akun Google yang akan ditambahkan

password String: sandi akun

sync boolean: true jika sinkronisasi otomatis harus diaktifkan untuk akun ini

waitForCheckin boolean: true untuk menunggu check-in setelah menambahkan akun

Hasil
boolean true jika akun berhasil dibuat, false jika tidak

Menampilkan
DeviceNotAvailableException

hasAccount

public static boolean hasAccount (ITestDevice device, 
                int userId)

Periksa apakah ada akun di perangkat.

Parameter
device ITestDevice: ITestDevice yang diperiksa untuk akun

userId int: ID pengguna yang akan diperiksa

Hasil
boolean

Menampilkan
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

installUtil

public static boolean installUtil (ITestDevice device)

Parameter
device ITestDevice

Hasil
boolean

Menampilkan
DeviceNotAvailableException

installUtil

public static boolean installUtil (ITestDevice device, 
                File altApk)

Instal APK utilitas akun yang ada dalam jar jika perlu

Parameter
device ITestDevice: tempat menginstal utilitas.

altApk File

Hasil
boolean

Menampilkan
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

isAccountUtilInstalled

public static boolean isAccountUtilInstalled (ITestDevice device)

Memeriksa apakah utilitas akun saat ini sudah diinstal

Parameter
device ITestDevice: untuk memeriksa apakah utilitas akun diinstal

Hasil
boolean

Menampilkan
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

removeAccountAttempt

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

Menghapus satu akun yang ditentukan

Parameter
accountName String

Hasil
boolean benar jika penghapusan berhasil, salah jika tidak.

Menampilkan
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

removeAllAccountAttempt

public static boolean removeAllAccountAttempt (ITestDevice device, 
                int userId)

Menghapus semua akun dari perangkat

Hasil
boolean benar jika penghapusan berhasil, salah jika tidak.

Menampilkan
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

syncAndOff

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

Menonaktifkan sinkronisasi dengan Akun Google yang ditentukan. Asumsikan sinkronisasi Aktif.

Parameter
device ITestDevice: ITestDevice

userId int: ID pengguna yang akan menjalankan operasi ini

accountName String: nama lengkap akun Google untuk menonaktifkan sinkronisasi

syncThenOff long: detik untuk mengizinkan sinkronisasi berjalan sebelum menonaktifkannya

Hasil
boolean true jika sinkronisasi berhasil dinonaktifkan

Menampilkan
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

syncOn

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

Mengaktifkan sinkronisasi dengan Akun Google yang ditentukan. Asumsikan sinkronisasi salah;

Parameter
device ITestDevice: ITestDevice

userId int: ID pengguna yang akan menjalankan operasi ini

accountName String: nama lengkap akun Google untuk mengaktifkan sinkronisasi

Hasil
boolean true jika sinkronisasi berhasil dinonaktifkan

Menampilkan
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

uninstallUtil

public static boolean uninstallUtil (ITestDevice device)

Meng-uninstal APK utilitas akun yang ada dalam JAR

Parameter
device ITestDevice: untuk menghapus utilitas akun dari.

Hasil
boolean

Menampilkan
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

waitForAccountSync

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

Tunggu hingga perangkat selesai menyinkronkan.

Parameter
device ITestDevice

userId int

interval long

timeout long

forceSync boolean

Hasil
boolean

Menampilkan
DeviceNotAvailableException