DeviceMonitor

public final class DeviceMonitor
extends Object implements ClientTracker

java.lang.Object
   ↳ com.android.tradefed.device.server.DeviceMonitor


DeviceMonitor は adb に接続されたデバイスをモニタリングします。

1 つのスレッドで DeviceListMonitorTask を実行します。これにより、adb ホストへのソケット接続が確立され、ERROR(/DeviceListMonitorTask.ADB_TRACK_DEVICES_COMMAND) が発行されます。その後、デバイスの接続とデバイスの状態に関するすべての変更について、そのソケットをモニタリングします。::getClientSupport が有効になっていない場合、DeviceClientMonitorTask は実行されず、デバイスは登録されません。

別のスレッドで DeviceClientMonitorTask を実行します。これにより、登録済みデバイスごとに adb ホストへのソケット接続が確立され、ERROR(/DeviceClientMonitorTask.ADB_TRACK_JDWP_COMMAND) が発行されます。この接続で、デバイス上のアクティブなクライアントを監視します。注: 1 つのスレッドがすべてのデバイスからの jdwp 接続をモニタリングします。adb へのさまざまなソケット接続(デバイスごとに 1 つ)は、単一のセレクタで多重化されます。

概要

ネストされたクラス

class DeviceMonitor.DeviceListComparisonResult

 

パブリック コンストラクタ

DeviceMonitor(AndroidDebugBridge server)

新しい DeviceMonitor オブジェクトを作成し、実行中の AndroidDebugBridge オブジェクトにリンクします。

パブリック メソッド

int getConnectionAttemptCount()
IDevice[] getDevices()

デバイスを返します。

int getRestartAttemptCount()
boolean hasInitialDeviceList()
boolean isMonitoring()

モニターが現在デバッグ ブリッジ サーバーに接続されているかどうかを返します。

void start()

モニタリングを開始します。

void stop()

モニタリングを停止します。

void trackClientToDropAndReopen(ClientImpl client)

クライアントがドロップされたが、クライアントとの接続を再開する試みを行う必要があることを示すコールバック。

void trackDeviceToDropAndReopen(DeviceImpl device)

デバイスがドロップされたことを示すコールバック。

void trackDisconnectedClient(ClientImpl client)

クライアントが切断されたときのコールバック。

パブリック コンストラクタ

DeviceMonitor

public DeviceMonitor (AndroidDebugBridge server)

新しい DeviceMonitor オブジェクトを作成し、実行中の AndroidDebugBridge オブジェクトにリンクします。

パラメータ
server AndroidDebugBridge: 実行中の AndroidDebugBridge

パブリック メソッド

getConnectionAttemptCount

public int getConnectionAttemptCount ()

戻り値
int

getDevices

public IDevice[] getDevices ()

デバイスを返します。

戻り値
IDevice[]

getRestartAttemptCount

public int getRestartAttemptCount ()

戻り値
int

hasInitialDeviceList

public boolean hasInitialDeviceList ()

戻り値
boolean

isMonitoring

public boolean isMonitoring ()

モニターが現在デバッグ ブリッジ サーバーに接続されているかどうかを返します。

戻り値
boolean

start

public void start ()

モニタリングを開始します。

経由地

public void stop ()

モニタリングを停止します。

trackClientToDropAndReopen

public void trackClientToDropAndReopen (ClientImpl client)

クライアントがドロップされたが、クライアントとの接続を再開する試みを行う必要があることを示すコールバック。

パラメータ
client ClientImpl: がドロップされました。

trackDeviceToDropAndReopen

public void trackDeviceToDropAndReopen (DeviceImpl device)

デバイスがドロップされたことを示すコールバック。デバイスとの接続を再開し、そのデバイスで実行されているクライアントとの接続を再確立する必要があります。

パラメータ
device DeviceImpl: がドロップされました。

trackDisconnectedClient

public void trackDisconnectedClient (ClientImpl client)

クライアントが切断されたときのコールバック。このコールバックは、クライアント ソケットへの登録を保持しているスレッドに、その登録を解放するよう通知するためのものです。

パラメータ
client ClientImpl: がドロップされました