You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: vendor/vendor-android/ddmlib/src/main/kotlin/com/malinskiy/marathon/android/ddmlib/DdmlibDeviceProvider.kt
+1-21
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,6 @@ import java.time.Duration
36
36
importjava.util.concurrent.ConcurrentHashMap
37
37
importjava.util.concurrent.ConcurrentMap
38
38
importjava.util.concurrent.TimeUnit
39
-
importjava.util.concurrent.atomic.AtomicBoolean
40
39
41
40
classDdmlibDeviceProvider(
42
41
privatevaltrack:Track,
@@ -93,29 +92,11 @@ class DdmlibDeviceProvider(
93
92
}
94
93
}
95
94
96
-
if (!adb.hasInitialDeviceList() ||printStackTraceAfterTimeout { !adb.hasDevices() }) {
95
+
if (!adb.hasInitialDeviceList() ||!adb.hasDevices()) {
97
96
throwNoDevicesException()
98
97
}
99
98
}
100
99
101
-
privatefun <T> printStackTraceAfterTimeout(block: () ->T): T {
102
-
val currentThread =Thread.currentThread()
103
-
val isBlockFinished =AtomicBoolean(false)
104
-
105
-
Thread {
106
-
Thread.sleep(PRINT_LOG_TIMEOUT)
107
-
if (!isBlockFinished.get() && currentThread.isAlive) {
108
-
logger.debug("Task is not finished within timeout. Printing thread stacktrace:", currentThread.stackTrace)
0 commit comments