Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device monitor event incorrectly states device is online when it is not. #24

Open
camalot opened this issue May 19, 2016 · 0 comments
Open
Labels

Comments

@camalot
Copy link
Owner

camalot commented May 19, 2016

Original Bug on CodePlex

the device monitor connection event always states the device is online even if the state of the device is not online.

current code has a line that switches the newdevice state to online even though adb is not reporting it online. A device coming this way via the event will be listed as online but will be offline if you find the same device via the AndroidDebugBridge Devices Propety which uses AdbHelper.Instance.GetDevices

// at this point we should still have some new devices in newList, so we
// process them.
foreach ( Device newDevice in list ) {
  // add them to the list
  Devices.Add ( newDevice );
  if ( Server != null ) {
    newDevice.State = DeviceState.Online;
    newDevice.OnStateChanged ( EventArgs.Empty );
    Server.OnDeviceConnected ( new DeviceEventArgs ( newDevice ) );
  }
  // start monitoring them.
  if ( AndroidDebugBridge.ClientSupport ) {
    if ( newDevice.IsOnline ) {
      StartMonitoringDevice ( newDevice );
    }
  }
  // look for their build info.
  if ( newDevice.IsOnline ) {
    QueryNewDeviceForInfo ( newDevice );
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant