اعتبارًا من عام 2026، ولضمان اتّساق نموذج التطوير الثابت الأساسي واستقرار المنصة في النظام المتكامل، سننشر رمز المصدر في مشروع Android مفتوح المصدر (AOSP) في الربعَين الثاني والرابع. لبناء مشروع Android مفتوح المصدر والمساهمة فيه، استخدِم android-latest-release. سيشير فرع بيان android-latest-release دائمًا إلى أحدث إصدار تم نشره في مشروع Android مفتوح المصدر. لمزيد من المعلومات، يُرجى الاطّلاع على التغييرات في مشروع Android مفتوح المصدر.
Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
GoogleAccountUtil
public
class
GoogleAccountUtil
extends Object
| java.lang.Object
|
| ↳ |
com.google.android.tradefed.util.GoogleAccountUtil
|
أداة مساعدة تتيح إعداد حسابات Google على جهاز
ملخّص
الإجراءات العامة |
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
Constant Value:
"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 في حال عدم توفّرها |
hasAccount
public static boolean hasAccount (ITestDevice device,
int userId)
تحقَّق مما إذا كان هناك حساب على الجهاز.
| المعلَمات |
device |
ITestDevice: ITestDevice الذي تم البحث عنه للعثور على حساب |
userId |
int: رقم تعريف المستخدم id المطلوب التحقّق منه |
installUtil
public static boolean installUtil (ITestDevice device)
| المعلَمات |
device |
ITestDevice |
installUtil
public static boolean installUtil (ITestDevice device,
File altApk)
تثبيت حزمة APK لأداة الحساب المضمّنة في ملف JAR إذا لزم الأمر
| المعلَمات |
device |
ITestDevice: لتثبيت الأداة المساعدة. |
altApk |
File |
isAccountUtilInstalled
public static boolean isAccountUtilInstalled (ITestDevice device)
التحقّق مما إذا كانت أداة الحساب مثبّتة حاليًا
| المعلَمات |
device |
ITestDevice: لتحديد ما إذا كانت أداة الحساب مثبّتة |
removeAccountAttempt
public static boolean removeAccountAttempt (ITestDevice device,
int userId,
String accountName)
إزالة الحساب الفردي المحدّد
| المعلَمات |
accountName |
String |
| المرتجعات |
boolean |
صحيح إذا تمت الإزالة بنجاح، وخطأ في الحالات الأخرى. |
removeAllAccountAttempt
public static boolean removeAllAccountAttempt (ITestDevice device,
int userId)
إزالة جميع الحسابات من الجهاز
| المرتجعات |
boolean |
صحيح إذا تمت الإزالة بنجاح، وخطأ في الحالات الأخرى. |
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 في حال تم إيقاف المزامنة بنجاح |
syncOn
public static boolean syncOn (ITestDevice device,
int userId,
String accountName)
تفعيل المزامنة مع حساب Google المحدّد افترِض أنّ المزامنة غير صحيحة؛
| المعلَمات |
device |
ITestDevice: ITestDevice |
userId |
int: رقم تعريف المستخدم الذي سيتم تنفيذ هذه العملية عليه |
accountName |
String: الاسم الكامل لحساب Google الذي سيتم تفعيل المزامنة فيه |
| المرتجعات |
boolean |
true في حال تم إيقاف المزامنة بنجاح |
uninstallUtil
public static boolean uninstallUtil (ITestDevice device)
إلغاء تثبيت حزمة APK لأداة الحساب المتضمّنة في ملف JAR
| المعلَمات |
device |
ITestDevice: لإلغاء تثبيت أداة الحساب. |
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 |
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2026-06-22 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2026-06-22 (حسب التوقيت العالمي المتفَّق عليه)"],[],[]]