Mulai 27 Maret 2025, sebaiknya gunakan android-latest-release
, bukan aosp-main
, untuk mem-build dan berkontribusi pada AOSP. Untuk mengetahui informasi selengkapnya, lihat Perubahan pada AOSP.
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
DeviceMonitorMultiplexer
public
class
DeviceMonitorMultiplexer
extends Object
implements
IDeviceMonitor
java.lang.Object
|
↳ |
com.android.tradefed.device.DeviceMonitorMultiplexer
|
Class proxy untuk menyebarkan permintaan ke beberapa IDeviceMonitor
.
Ringkasan
Konstruktor publik
DeviceMonitorMultiplexer
public DeviceMonitorMultiplexer ()
Metode publik
addMonitor
public void addMonitor (IDeviceMonitor globalDeviceMonitor)
Parameter |
globalDeviceMonitor |
IDeviceMonitor |
addMonitors
public void addMonitors ( globalDeviceMonitors)
Parameter |
globalDeviceMonitors |
|
notifyDeviceStateChange
public void notifyDeviceStateChange (String serial,
DeviceAllocationState oldState,
DeviceAllocationState newState)
Memberi sinyal ke IDeviceMonitor
bahwa status perangkat telah diubah.
Penerapan monitor harus membatasi jumlah pemrosesan dan
interaksi IDeviceManager/DeviceLister yang dilakukan dalam metode ini.
Parameter |
serial |
String |
oldState |
DeviceAllocationState |
newState |
DeviceAllocationState |
removeMonitor
public void removeMonitor (IDeviceMonitor mon)
Parameter |
mon |
IDeviceMonitor |
lari
public void run ()
Metode yang akan dipanggil setelah semua kolom @Option Monitor ditetapkan.
setDeviceLister
public void setDeviceLister (IDeviceMonitor.DeviceLister lister)
Memungkinkan DeviceLister
ditetapkan. Setelah berhasil mencoba menetapkan Lister,
implementasi dapat menghapus semua upaya berikutnya.
Parameter |
lister |
IDeviceMonitor.DeviceLister |
berhenti
public void stop ()
Metode yang akan dipanggil saat Monitor perlu dihentikan.
Konten dan contoh kode di halaman ini tunduk kepada lisensi yang dijelaskan dalam Lisensi Konten. Java dan OpenJDK adalah merek dagang atau merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-27 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-07-27 UTC."],[],[],null,["# DeviceMonitorMultiplexer\n========================\n\n\n`\npublic\n\n\nclass\nDeviceMonitorMultiplexer\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\nimplements\n\n`[IDeviceMonitor](../../../../../../reference/tradefed/com/android/tradefed/device/IDeviceMonitor.html)`\n\n\n`\n\n|---|------------------------------------------------------|\n| java.lang.Object ||\n| ↳ | com.android.tradefed.device.DeviceMonitorMultiplexer |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA proxy class to propagate requests to multiple [IDeviceMonitor](../../../../../../reference/tradefed/com/android/tradefed/device/IDeviceMonitor.html)s.\n\nSummary\n-------\n\n| ### Public constructors ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[DeviceMonitorMultiplexer](../../../../../../reference/tradefed/com/android/tradefed/device/DeviceMonitorMultiplexer.html#DeviceMonitorMultiplexer())`() ` |\n\n| ### Public methods ||\n|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` void` | ` `[addMonitor](../../../../../../reference/tradefed/com/android/tradefed/device/DeviceMonitorMultiplexer.html#addMonitor(com.android.tradefed.device.IDeviceMonitor))`(`[IDeviceMonitor](../../../../../../reference/tradefed/com/android/tradefed/device/IDeviceMonitor.html)` globalDeviceMonitor) ` |\n| ` void` | ` `[addMonitors](../../../../../../reference/tradefed/com/android/tradefed/device/DeviceMonitorMultiplexer.html#addMonitors(\u003cany\u003e))`(` globalDeviceMonitors) |\n| ` void` | ` `[notifyDeviceStateChange](../../../../../../reference/tradefed/com/android/tradefed/device/DeviceMonitorMultiplexer.html#notifyDeviceStateChange(java.lang.String,%20com.android.tradefed.device.DeviceAllocationState,%20com.android.tradefed.device.DeviceAllocationState))`(String serial, `[DeviceAllocationState](../../../../../../reference/tradefed/com/android/tradefed/device/DeviceAllocationState.html)` oldState, `[DeviceAllocationState](../../../../../../reference/tradefed/com/android/tradefed/device/DeviceAllocationState.html)` newState) ` Signals the [IDeviceMonitor](../../../../../../reference/tradefed/com/android/tradefed/device/IDeviceMonitor.html) that a device state has been changed. |\n| ` void` | ` `[removeMonitor](../../../../../../reference/tradefed/com/android/tradefed/device/DeviceMonitorMultiplexer.html#removeMonitor(com.android.tradefed.device.IDeviceMonitor))`(`[IDeviceMonitor](../../../../../../reference/tradefed/com/android/tradefed/device/IDeviceMonitor.html)` mon) ` |\n| ` void` | ` `[run](../../../../../../reference/tradefed/com/android/tradefed/device/DeviceMonitorMultiplexer.html#run())`() ` A method that will be called after all of the Monitor's @Option fields have been set. |\n| ` void` | ` `[setDeviceLister](../../../../../../reference/tradefed/com/android/tradefed/device/DeviceMonitorMultiplexer.html#setDeviceLister(com.android.tradefed.device.IDeviceMonitor.DeviceLister))`(`[IDeviceMonitor.DeviceLister](../../../../../../reference/tradefed/com/android/tradefed/device/IDeviceMonitor.DeviceLister.html)` lister) ` Allows the [DeviceLister](../../../../../../reference/tradefed/com/android/tradefed/device/IDeviceMonitor.DeviceLister.html) to be set. |\n| ` void` | ` `[stop](../../../../../../reference/tradefed/com/android/tradefed/device/DeviceMonitorMultiplexer.html#stop())`() ` A method that will be called when the Monitor need to be stopped. |\n\nPublic constructors\n-------------------\n\n### DeviceMonitorMultiplexer\n\n```\npublic DeviceMonitorMultiplexer ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### addMonitor\n\n```\npublic void addMonitor (IDeviceMonitor globalDeviceMonitor)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------------------|-------------------------|\n| `globalDeviceMonitor` | `IDeviceMonitor` \u003cbr /\u003e |\n\n### addMonitors\n\n```\npublic void addMonitors ( globalDeviceMonitors)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------------------|--------|\n| `globalDeviceMonitors` | \u003cbr /\u003e |\n\n### notifyDeviceStateChange\n\n```\npublic void notifyDeviceStateChange (String serial, \n DeviceAllocationState oldState, \n DeviceAllocationState newState)\n```\n\nSignals the [IDeviceMonitor](../../../../../../reference/tradefed/com/android/tradefed/device/IDeviceMonitor.html) that a device state has been changed.\nMonitor implementations should limit the amount of processing and\nIDeviceManager/DeviceLister interaction they do in this method.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|--------------------------------|\n| `serial` | `String` \u003cbr /\u003e |\n| `oldState` | `DeviceAllocationState` \u003cbr /\u003e |\n| `newState` | `DeviceAllocationState` \u003cbr /\u003e |\n\n### removeMonitor\n\n```\npublic void removeMonitor (IDeviceMonitor mon)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------|-------------------------|\n| `mon` | `IDeviceMonitor` \u003cbr /\u003e |\n\n### run\n\n```\npublic void run ()\n```\n\nA method that will be called after all of the Monitor's @Option fields have been set.\n\n\u003cbr /\u003e\n\n### setDeviceLister\n\n```\npublic void setDeviceLister (IDeviceMonitor.DeviceLister lister)\n```\n\nAllows the [DeviceLister](../../../../../../reference/tradefed/com/android/tradefed/device/IDeviceMonitor.DeviceLister.html) to be set. After a successful attempt to set the Lister,\nimplementations may discard all subsequent attempts.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|--------------------------------------|\n| `lister` | `IDeviceMonitor.DeviceLister` \u003cbr /\u003e |\n\n### stop\n\n```\npublic void stop ()\n```\n\nA method that will be called when the Monitor need to be stopped.\n\n\u003cbr /\u003e"]]