IDeviceMonitor

public interface IDeviceMonitor

com.android.tradefed.device.IDeviceMonitor


デバイスの状態をモニタリングするためのインターフェース。IDeviceManager に渡されることを想定しています。 その場合、IDeviceManager は関連するイベントとしてコールバックを呼び出します。 トリガーされますキャッシュ保存やバッチ処理は、IDeviceMonitor 内で行う必要があります。 作成します。

概要

ネストされたクラス

class IDeviceMonitor.DeviceLister

既知のデバイスとその状態を返す Runnable のようなクラス。 

パブリック メソッド

abstract void notifyDeviceStateChange(String serial, DeviceAllocationState oldState, DeviceAllocationState newState)

デバイスの状態が変更されたことを IDeviceMonitor に通知します。

abstract void run()

Monitor のすべての @Option フィールドが設定された後に呼び出されるメソッドです。

abstract void setDeviceLister(IDeviceMonitor.DeviceLister lister)

DeviceLister を設定できます。

abstract void stop()

Monitor を停止する必要がある場合に呼び出されるメソッドです。

パブリック メソッド

notifyDeviceStateChange

public abstract void notifyDeviceStateChange (String serial, 
                DeviceAllocationState oldState, 
                DeviceAllocationState newState)

デバイスの状態が変更されたことを IDeviceMonitor に通知します。 モニタリングの実装では、処理の量を制限し、 このメソッドで行われる IDeviceManager/DeviceLister のインタラクション。

パラメータ
serial String

oldState DeviceAllocationState

newState DeviceAllocationState

ホームラン

public abstract void run ()

Monitor のすべての @Option フィールドが設定された後に呼び出されるメソッドです。

setDeviceLister

public abstract void setDeviceLister (IDeviceMonitor.DeviceLister lister)

DeviceLister を設定できます。Lister の設定に成功すると、 実装が後続のすべての試行を破棄する場合があります。

パラメータ
lister IDeviceMonitor.DeviceLister

経由地

public abstract void stop ()

Monitor を停止する必要がある場合に呼び出されるメソッドです。