RemoteAndroidDevice
  public
  
  
  
  class
  RemoteAndroidDevice
  
  
  
  
  
  
  
    extends TestDevice
  
  
  
  
  
  
| java.lang.Object | |||
| ↳ | com.android.tradefed.device.NativeDevice | ||
| ↳ | com.android.tradefed.device.TestDevice | ||
| ↳ | com.android.tradefed.device.RemoteAndroidDevice | ||
تنفيذ ITestDevice لجهاز Android مزوّد بمجموعة كاملة من الأدوات ومتصل عبر
 adb connect
 لنفترض أنّ الرقم التسلسلي للجهاز سيكون بالتنسيق 
ملخّص
| الثابتات | |
|---|---|
| long | DEFAULT_SHORT_CMD_TIMEOUT
 | 
| int | MAX_RETRIES
 | 
| long | RETRY_INTERVAL_MS
 | 
| long | WAIT_FOR_ADB_CONNECT
 | 
| وظائف الإنشاء العامة | |
|---|---|
| 
      RemoteAndroidDevice(IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
      لإنشاء  | |
| الطرق العامة | |
|---|---|
| 
        
        
        static
        
        
        boolean | 
      checkSerialFormatValid(String serialString)
      تحقَّق مما إذا كان تنسيق السلسلة كما هو متوقّع  | 
| 
        
        
        
        
        
        boolean | 
      connectToWifiNetwork(الاتصال بشبكة Wi-Fi | 
| 
        
        
        
        
        
        DeviceDescriptor | 
      getDeviceDescriptor(boolean shortDescriptor)
      عرض  | 
| 
        
        
        
        
        
        String | 
      getMacAddress()
      تعرِض هذه السمة عنوان MAC للجهاز، وتكون قيمة هذه السمة فارغة إذا تعذّر إجراء طلب بحث من الجهاز. | 
| 
        
        
        
        
        
        boolean | 
      isEncryptionSupported()
      يعرض ما إذا كان التشفير متاحًا على الجهاز. | 
الثابتات
DEFAULT_SHORT_CMD_TIMEOUT
protected static final long DEFAULT_SHORT_CMD_TIMEOUT
القيمة الثابتة: 20000 (0x0000000000004e20)
MAX_RETRIES
protected static final int MAX_RETRIES
القيمة الثابتة: 5 (0x00000005)
RETRY_INTERVAL_MS
protected static final long RETRY_INTERVAL_MS
القيمة الثابتة: 5000 (0x0000000000001388)
WAIT_FOR_ADB_CONNECT
public static final long WAIT_FOR_ADB_CONNECT
القيمة الثابتة: 120000 (0x000000000001d4c0)
وظائف الإنشاء العامة
RemoteAndroidDevice
public RemoteAndroidDevice (IDevice device, 
                IDeviceStateMonitor stateMonitor, 
                IDeviceMonitor allocationMonitor)لإنشاء RemoteAndroidDevice.
| المعلمات | |
|---|---|
| device | IDevice:IDeviceالمرتبط | 
| stateMonitor | IDeviceStateMonitor: آليةIDeviceStateMonitorالمُستخدَمة | 
| allocationMonitor | IDeviceMonitor:IDeviceMonitorلإعلامك بتغييرات حالة التخصيص | 
الطرق العامة
checkSerialFormatValid
public static boolean checkSerialFormatValid (String serialString)
تحقَّق مما إذا كان تنسيق السلسلة كما هو متوقّع 
| المعلمات | |
|---|---|
| serialString | String | 
| المرتجعات | |
|---|---|
| boolean | صحيح إذا كان التنسيق صالحًا، وخطأ في الحالات الأخرى | 
connectToWifiNetwork
public boolean connectToWifiNetwork (wifiSsidToPsk, boolean scanSsid) 
الاتصال بشبكة Wi-Fi
تفعِّل شبكة Wi-Fi وتحظرها إلى أن يتم إجراء اتصال ناجح بإحدى شبكات Wi-Fi
 المُدرَجة في خريطة wifiSsidToPsk. بعد إجراء الاتصال، سيحاول المثيل
 استعادة الاتصال بعد كل عملية إعادة تشغيل إلى أن يتم استدعاء ITestDevice.disconnectFromWifi() أو
 ITestDevice.clearLastConnectedWifiNetwork().
| المعلمات | |
|---|---|
| wifiSsidToPsk | : خريطة لمعرّفات SSID لشبكات Wi-Fi وكلمات المرور | 
| scanSsid |  boolean: ما إذا كان سيتم البحث عن معرّفات SSID مخفية لهذه الشبكة | 
| المرتجعات | |
|---|---|
| boolean | trueإذا تم الاتصال بشبكة Wi-Fi بنجاحfalseوإلا | 
| عمليات الرمي | |
|---|---|
| DeviceNotAvailableException | |
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor (boolean shortDescriptor)
عرض DeviceDescriptor من معلومات الجهاز للحصول على معلومات عنه بدون
 تمرير عنصر الجهاز الفعلي
| المعلمات | |
|---|---|
| shortDescriptor | boolean: ما إذا كان يجب حصر الوصف في الحد الأدنى من المعلومات أم لا | 
| المرتجعات | |
|---|---|
| DeviceDescriptor | |
getMacAddress
public String getMacAddress ()
تعرِض هذه السمة عنوان MAC للجهاز، وتكون قيمة هذه السمة فارغة إذا تعذّر إجراء طلب بحث من الجهاز.
| المرتجعات | |
|---|---|
| String | |
isEncryptionSupported
public boolean isEncryptionSupported ()
يعرض ما إذا كان التشفير متاحًا على الجهاز.
| المرتجعات | |
|---|---|
| boolean | trueإذا كان الجهاز يتيح التشفير | 
