Sl4aBluetoothUtil
public class Sl4aBluetoothUtil
extends Object
java.lang.Object |
↳ | com.android.tradefed.util.Sl4aBluetoothUtil |
توفر فئة الأداة المساعدة عمليات Bluetooth على جهاز واحد أو جهازين باستخدام SL4A
ملخص
الأساليب العامة |
---|
boolean | changeProfileAccessPermission ( ITestDevice primary, ITestDevice secondary, Sl4aBluetoothUtil.BluetoothProfile profile, Sl4aBluetoothUtil.BluetoothAccessLevel access) قم بتغيير إذن الوصول إلى ملف تعريف Bluetooth للجهاز الثانوي على الجهاز الأساسي حتى يتمكن الجهاز الثانوي من الوصول إلى الجهاز الأساسي في ملف التعريف المحدد |
boolean | connect ( ITestDevice primary, ITestDevice secondary, profiles) connect ( ITestDevice primary, ITestDevice secondary, profiles) قم بتوصيل الجهاز الأساسي بالجهاز الثانوي في ملفات تعريف Bluetooth المحددة |
boolean | disable ( ITestDevice device) قم بتعطيل البلوتوث على الجهاز المستهدف |
boolean | disableBluetoothSnoopLog ( ITestDevice device) تعطيل سجل التطفل بلوتوث |
boolean | disconnect ( ITestDevice primary, ITestDevice secondary, profiles) disconnect ( ITestDevice primary, ITestDevice secondary, profiles) افصل الجهاز الأساسي عن الجهاز الثانوي |
boolean | enable ( ITestDevice device) تمكين البلوتوث على الجهاز المستهدف |
boolean | enableBluetoothSnoopLog ( ITestDevice device) تمكين سجل التطفل بلوتوث |
String | getAddress ( ITestDevice device) احصل على عنوان Bluetooth MAC للجهاز المستهدف |
| getBondedDevices ( ITestDevice device) احصل على مجموعة من عناوين Bluetooth MAC للأجهزة المرتبطة (المقترنة) على الجهاز المستهدف |
boolean | pair ( ITestDevice primary, ITestDevice secondary) إقران الجهاز الأساسي بجهاز ثانوي |
void | setBtConnectionTimeout (Duration timeout) |
void | setBtPairTimeout (Duration timeout) |
boolean | setProfilePriority ( ITestDevice primary, ITestDevice secondary, profiles, Sl4aBluetoothUtil.BluetoothPriorityLevel priority) setProfilePriority ( ITestDevice primary, ITestDevice secondary, profiles, Sl4aBluetoothUtil.BluetoothPriorityLevel priority) قم بتغيير إعداد الأولوية لملفات التعريف المحددة على الجهاز الأساسي نحو الجهاز الثانوي |
void | startSl4a ( ITestDevice device, File sl4aApkFile) ابدأ تشغيل عميل SL4A بشكل صريح بالجهاز المحدد وملف SL4A apk. |
void | stopSl4a () أوقف عملاء SL4A الذين تم فتحهم بالفعل. |
boolean | unpairAll ( ITestDevice device) قم بإلغاء إقران جميع الأجهزة المقترنة بالجهاز الحالي |
الأساليب المحمية |
---|
void | finalize () تنظيف كافة اتصالات SL4A |
المقاولين العامة
Sl4aBluetoothUtil
public Sl4aBluetoothUtil ()
الأساليب العامة
ChangeProfileAccessPermission
public boolean changeProfileAccessPermission (ITestDevice primary,
ITestDevice secondary,
Sl4aBluetoothUtil.BluetoothProfile profile,
Sl4aBluetoothUtil.BluetoothAccessLevel access)
قم بتغيير إذن الوصول إلى ملف تعريف Bluetooth للجهاز الثانوي على الجهاز الأساسي حتى يتمكن الجهاز الثانوي من الوصول إلى الجهاز الأساسي في ملف التعريف المحدد
حدود |
---|
primary | ITestDevice : جهاز لتغيير الإذن |
secondary | ITestDevice : الجهاز الذي يصل إلى الجهاز الأساسي في ملف التعريف المحدد |
profile | Sl4aBluetoothUtil.BluetoothProfile : ملف تعريف Bluetooth للوصول |
access | Sl4aBluetoothUtil.BluetoothAccessLevel : مستوى الوصول، راجع BluetoothAccessLevel |
عائدات |
---|
boolean | صحيح إذا تم تغيير الإذن بنجاح |
يتصل
public boolean connect (ITestDevice primary,
ITestDevice secondary,
profiles)
قم بتوصيل الجهاز الأساسي بالجهاز الثانوي في ملفات تعريف Bluetooth المحددة
حدود |
---|
primary | ITestDevice : الجهاز الذي سيتم الاتصال منه |
secondary | ITestDevice : الجهاز الذي سيتم الاتصال به |
profiles | : يلزم توصيل مجموعة من ملفات تعريف Bluetooth |
عائدات |
---|
boolean | صحيح إذا كان الاتصال ناجحا |
إبطال
public boolean disable (ITestDevice device)
قم بتعطيل البلوتوث على الجهاز المستهدف
حدود |
---|
device | ITestDevice : الجهاز المستهدف |
عائدات |
---|
boolean | صحيح إذا تم تعطيل Bluetooth بنجاح |
تعطيلBluetoothSnoopLog
public boolean disableBluetoothSnoopLog (ITestDevice device)
تعطيل سجل التطفل بلوتوث
حدود |
---|
device | ITestDevice : لتعطيل سجل التطفل |
عائدات |
---|
boolean | صحيح إذا تم تعطيله بنجاح |
قطع الاتصال
public boolean disconnect (ITestDevice primary,
ITestDevice secondary,
profiles)
افصل الجهاز الأساسي عن الجهاز الثانوي
حدود |
---|
primary | ITestDevice : جهاز لإجراء عملية قطع الاتصال |
secondary | ITestDevice : الجهاز المراد فصله |
profiles | : مجموعة معينة من ملفات تعريف Bluetooth المطلوبة لفصلها |
عائدات |
---|
boolean | صحيح إذا تم قطع الاتصال بنجاح |
يُمكَِن
public boolean enable (ITestDevice device)
تمكين البلوتوث على الجهاز المستهدف
حدود |
---|
device | ITestDevice : الجهاز المستهدف |
عائدات |
---|
boolean | صحيح إذا تم تمكين البلوتوث بنجاح |
تمكينBluetoothSnoopLog
public boolean enableBluetoothSnoopLog (ITestDevice device)
تمكين سجل التطفل بلوتوث
حدود |
---|
device | ITestDevice : لتمكين سجل التطفل |
عائدات |
---|
boolean | صحيح إذا تم تمكينه بنجاح |
getAddress
public String getAddress (ITestDevice device)
احصل على عنوان Bluetooth MAC للجهاز المستهدف
حدود |
---|
device | ITestDevice : الجهاز المستهدف |
عائدات |
---|
String | سلسلة عنوان MAC |
getBondedDevices
public getBondedDevices (ITestDevice device)
احصل على مجموعة من عناوين Bluetooth MAC للأجهزة المرتبطة (المقترنة) على الجهاز المستهدف
حدود |
---|
device | ITestDevice : الجهاز المستهدف |
عائدات |
---|
| مجموعة عناوين MAC الخاصة بالبلوتوث |
زوج
public boolean pair (ITestDevice primary,
ITestDevice secondary)
إقران الجهاز الأساسي بجهاز ثانوي
حدود |
---|
primary | ITestDevice : جهاز للإقران منه |
secondary | ITestDevice : جهاز للاقتران به |
عائدات |
---|
boolean | صحيح إذا كان الاقتران ناجحا |
setBtConnectionTimeout
public void setBtConnectionTimeout (Duration timeout)
setBtPairTimeout
public void setBtPairTimeout (Duration timeout)
setProfilePriority
public boolean setProfilePriority (ITestDevice primary,
ITestDevice secondary,
profiles,
Sl4aBluetoothUtil.BluetoothPriorityLevel priority)
قم بتغيير إعداد الأولوية لملفات التعريف المحددة على الجهاز الأساسي نحو الجهاز الثانوي
حدود |
---|
primary | ITestDevice : الجهاز الذي سيتم تعيين الأولوية عليه |
secondary | ITestDevice : الجهاز الذي سيتم تعيين الأولوية له |
profiles | : ملفات تعريف Bluetooth لتغيير إعداد الأولوية |
priority | Sl4aBluetoothUtil.BluetoothPriorityLevel : مستوى الأولوية |
عائدات |
---|
boolean | صحيح إذا تم تعيين الأولوية بنجاح |
startSl4a
public void startSl4a (ITestDevice device,
File sl4aApkFile)
ابدأ تشغيل عميل SL4A بشكل صريح بالجهاز المحدد وملف SL4A apk. عادةً لا تكون هذه الطريقة مطلوبة، لأنه سيتم دائمًا إنشاء اتصال SL4A قبل العمليات الفعلية.
حدود |
---|
device | ITestDevice : الجهاز الذي سيتم توصيله باستخدام SL4A |
sl4aApkFile | File : ملف SL4A apk الاختياري للتثبيت والاستخدام. |
stopSl4a
public void stopSl4a ()
أوقف عملاء SL4A الذين تم فتحهم بالفعل. إنه يوفر بشكل أساسي طريقة لتنظيف العملاء فورًا بعد عدم استخدامها
unpairAll
public boolean unpairAll (ITestDevice device)
قم بإلغاء إقران جميع الأجهزة المقترنة بالجهاز الحالي
حدود |
---|
device | ITestDevice : الجهاز الحالي لتنفيذ الإجراء |
عائدات |
---|
boolean | صحيح إذا تم إلغاء الاقتران بنجاح |
الأساليب المحمية
وضع اللمسات الأخيرة
protected void finalize ()
تنظيف كافة اتصالات SL4A