IDeviceMonitor
public interface IDeviceMonitor
com.android.tradefed.device.IDeviceMonitor |
อินเทอร์เฟซสำหรับตรวจสอบสถานะของอุปกรณ์ ตั้งใจที่จะส่งผ่านไปยังอินสแตนซ์ IDeviceManager
เมื่อถึงจุดนั้น IDeviceManager
จะเรียกใช้การเรียกกลับเมื่อมีการทริกเกอร์เหตุการณ์ที่เกี่ยวข้อง ต้องดำเนินการแคชหรือแบทช์ภายในอินสแตนซ์ IDeviceMonitor
สรุป
คลาสที่ซ้อนกัน | |
---|---|
class | IDeviceMonitor.DeviceLister คลาสที่เหมือน |
วิธีการสาธารณะ | |
---|---|
abstract void | notifyDeviceStateChange (String serial, DeviceAllocationState oldState, DeviceAllocationState newState) ส่งสัญญาณ |
abstract void | run () เมธอดที่จะถูกเรียกหลังจากตั้งค่าฟิลด์ @Option ของ Monitor ทั้งหมดแล้ว |
abstract void | setDeviceLister ( IDeviceMonitor.DeviceLister lister) อนุญาตให้ตั้งค่า |
abstract void | stop () วิธีการที่จะเรียกเมื่อจำเป็นต้องหยุดการตรวจสอบ |
วิธีการสาธารณะ
notifyDeviceStateChange
public abstract void notifyDeviceStateChange (String serial, DeviceAllocationState oldState, DeviceAllocationState newState)
ส่งสัญญาณ IDeviceMonitor
ว่าสถานะอุปกรณ์มีการเปลี่ยนแปลง การตรวจสอบการใช้งานควรจำกัดจำนวนการประมวลผลและการโต้ตอบของ IDeviceManager/DeviceLister ที่พวกเขาทำในวิธีนี้
พารามิเตอร์ | |
---|---|
serial | String |
oldState | DeviceAllocationState |
newState | DeviceAllocationState |
วิ่ง
public abstract void run ()
เมธอดที่จะถูกเรียกหลังจากตั้งค่าฟิลด์ @Option ของ Monitor ทั้งหมดแล้ว
setDeviceLister
public abstract void setDeviceLister (IDeviceMonitor.DeviceLister lister)
อนุญาตให้ตั้งค่า DeviceLister
หลังจากพยายามตั้งค่า Lister สำเร็จ การใช้งานอาจละทิ้งความพยายามที่ตามมาทั้งหมด
พารามิเตอร์ | |
---|---|
lister | IDeviceMonitor.DeviceLister |
หยุด
public abstract void stop ()
วิธีการที่จะเรียกเมื่อจำเป็นต้องหยุดการตรวจสอบ
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2022-08-15 UTC.