Starting March 27, 2025, we recommend using android-latest-release
instead of aosp-main
to build and contribute to AOSP. For more information, see Changes to AOSP.
Stay organized with collections
Save and categorize content based on your preferences.
DeviceMonitorMultiplexer
public
class
DeviceMonitorMultiplexer
extends Object
implements
IDeviceMonitor
java.lang.Object
|
↳ |
com.android.tradefed.device.DeviceMonitorMultiplexer
|
A proxy class to propagate requests to multiple IDeviceMonitor
s.
Summary
Public constructors
DeviceMonitorMultiplexer
public DeviceMonitorMultiplexer ()
Public methods
addMonitor
public void addMonitor (IDeviceMonitor globalDeviceMonitor)
Parameters |
globalDeviceMonitor |
IDeviceMonitor |
addMonitors
public void addMonitors ( globalDeviceMonitors)
Parameters |
globalDeviceMonitors |
|
notifyDeviceStateChange
public void notifyDeviceStateChange (String serial,
DeviceAllocationState oldState,
DeviceAllocationState newState)
Signals the IDeviceMonitor
that a device state has been changed.
Monitor implementations should limit the amount of processing and
IDeviceManager/DeviceLister interaction they do in this method.
Parameters |
serial |
String |
oldState |
DeviceAllocationState |
newState |
DeviceAllocationState |
removeMonitor
public void removeMonitor (IDeviceMonitor mon)
Parameters |
mon |
IDeviceMonitor |
run
public void run ()
A method that will be called after all of the Monitor's @Option fields have been set.
setDeviceLister
public void setDeviceLister (IDeviceMonitor.DeviceLister lister)
Allows the DeviceLister
to be set. After a successful attempt to set the Lister,
implementations may discard all subsequent attempts.
Parameters |
lister |
IDeviceMonitor.DeviceLister |
stop
public void stop ()
A method that will be called when the Monitor need to be stopped.
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 2023-03-08 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-03-08 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"]]