Od 27 marca 2025 r. zalecamy używanie android-latest-release
zamiast aosp-main
do kompilowania i wspołtworzenia AOSP. Więcej informacji znajdziesz w artykule o zmianach w AOSP.
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
DeviceMonitorMultiplexer
public
class
DeviceMonitorMultiplexer
extends Object
implements
IDeviceMonitor
java.lang.Object
|
↳ |
com.android.tradefed.device.DeviceMonitorMultiplexer
|
Klasa pośrednicząca do rozsyłania żądań do wielu IDeviceMonitor
.
Podsumowanie
Konstruktory publiczne
DeviceMonitorMultiplexer
public DeviceMonitorMultiplexer ()
Metody publiczne
addMonitor
public void addMonitor (IDeviceMonitor globalDeviceMonitor)
Parametry |
globalDeviceMonitor |
IDeviceMonitor |
addMonitors
public void addMonitors ( globalDeviceMonitors)
Parametry |
globalDeviceMonitors |
|
notifyDeviceStateChange
public void notifyDeviceStateChange (String serial,
DeviceAllocationState oldState,
DeviceAllocationState newState)
Informuje IDeviceMonitor
, że stan urządzenia uległ zmianie.
Implementacje monitora powinny ograniczać ilość przetwarzania i interakcji z IDeviceManagerem/DeviceListerem w ramach tej metody.
Parametry |
serial |
String |
oldState |
DeviceAllocationState |
newState |
DeviceAllocationState |
removeMonitor
public void removeMonitor (IDeviceMonitor mon)
Parametry |
mon |
IDeviceMonitor |
home run
public void run ()
Metoda, która zostanie wywołana po ustawieniu wszystkich pól @Option obiektu Monitor.
setDeviceLister
public void setDeviceLister (IDeviceMonitor.DeviceLister lister)
Zezwala na ustawienie DeviceLister
. Po pomyślnym ustawieniu listera implementacje mogą odrzucać wszystkie kolejne próby.
Parametry |
lister |
IDeviceMonitor.DeviceLister |
zatrzymaj
public void stop ()
Metoda, która zostanie wywołana, gdy trzeba zatrzymać monitor.
Treść strony i umieszczone na niej fragmenty kodu podlegają licencjom opisanym w Licencji na treści. Java i OpenJDK są znakami towarowymi lub zastrzeżonymi znakami towarowymi należącymi do firmy Oracle lub jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-27 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 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"]]