def get_google_account_number(serial=None): """ description: this fubction return the google account number configured on DUT Return 0 if there is no Google account configured. usage: gms_utils.get_google_account_number() tags: google account, account number, google, check google, account """ db = "/data/system/users/0/accounts.db" table = "accounts" return adb_utils.sqlite_count_query(serial=serial, db=db, table=table)
def google_account_exists(serial=None, db="/data/system/users/0/accounts.db", table="accounts", where="1"): """ description: Check if a Google account is configured on the device from DB usage: ui_utils.google_account_exists() tags: ui, android, account, google, sqlite, db """ return int( adb_utils.sqlite_count_query(serial=serial, db=db, table=table, where=where)) == 1
def count_alarms( db="/data/data/com.google.android.deskclock/databases/alarms.db", table="alarm_instances", where="1"): return int(adb_utils.sqlite_count_query(db=db, table=table, where=where))