Skip to content

Commit

Permalink
Connect device only once
Browse files Browse the repository at this point in the history
  • Loading branch information
takahirom committed Jan 23, 2025
1 parent c23024b commit 6bb3276
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ private fun step(
return StepResult.Continue
}

public fun detectStuckScreen(lastScreenshot: String?, newScreenshot: File): Boolean {
private fun detectStuckScreen(lastScreenshot: String?, newScreenshot: File): Boolean {
if (lastScreenshot == null) {
return false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,10 @@ class ArbigentAppStateHolder(
if (devicesStateHolder.selectedDevice.value == null) {
devicesStateHolder.onSelectedDeviceChanged(devicesStateHolder.devices.value.firstOrNull())
}
val device = deviceFactory(devicesStateHolder.selectedDevice.value!!)
val selectedDevice = devicesStateHolder.selectedDevice.value!!
val device = deviceCache.getOrPut(selectedDevice) {
deviceFactory(devicesStateHolder.selectedDevice.value!!)
}
deviceConnectionState.value = DeviceConnectionState.Connected(device)
}
}
Expand Down

0 comments on commit 6bb3276

Please sign in to comment.