appium-espresso-driver 10.2.1 → 10.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/build/lib/commands/orientation.d.ts +33 -0
  3. package/build/lib/commands/orientation.d.ts.map +1 -0
  4. package/build/lib/commands/orientation.js +34 -0
  5. package/build/lib/commands/orientation.js.map +1 -0
  6. package/build/lib/commands/server/builder.d.ts +9 -0
  7. package/build/lib/commands/server/builder.d.ts.map +1 -1
  8. package/build/lib/commands/server/builder.js +23 -0
  9. package/build/lib/commands/server/builder.js.map +1 -1
  10. package/build/lib/commands/server/hints.d.ts +28 -0
  11. package/build/lib/commands/server/hints.d.ts.map +1 -0
  12. package/build/lib/commands/server/hints.js +54 -0
  13. package/build/lib/commands/server/hints.js.map +1 -0
  14. package/build/lib/commands/server/runner.d.ts +7 -0
  15. package/build/lib/commands/server/runner.d.ts.map +1 -1
  16. package/build/lib/commands/server/runner.js +43 -4
  17. package/build/lib/commands/server/runner.js.map +1 -1
  18. package/build/lib/driver.d.ts.map +1 -1
  19. package/build/lib/driver.js +13 -0
  20. package/build/lib/driver.js.map +1 -1
  21. package/build/lib/execute-method-map.d.ts +4 -0
  22. package/build/lib/execute-method-map.d.ts.map +1 -1
  23. package/espresso-server/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk +0 -0
  24. package/espresso-server/app/build.gradle.kts +91 -1
  25. package/espresso-server/app/src/androidTestShaded/AndroidManifest.xml +16 -0
  26. package/espresso-server/buildSrc/.gradle/9.7.1/executionHistory/executionHistory.bin +0 -0
  27. package/espresso-server/buildSrc/.gradle/9.7.1/executionHistory/executionHistory.lock +0 -0
  28. package/espresso-server/buildSrc/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  29. package/espresso-server/buildSrc/.gradle/buildOutputCleanup/cache.properties +1 -1
  30. package/espresso-server/buildSrc/build/classes/kotlin/main/META-INF/buildSrc.kotlin_module +0 -0
  31. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/AnnotationSkipper$visitField$1$1.class +0 -0
  32. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/AnnotationSkipper$visitMethod$1$1.class +0 -0
  33. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/AnnotationSkipper.class +0 -0
  34. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/MemberRef.class +0 -0
  35. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/PrefixRemapper.class +0 -0
  36. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/RelocateClassesTask$run$$inlined$groupingBy$1.class +0 -0
  37. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/RelocateClassesTask$run$$inlined$sortedByDescending$1.class +0 -0
  38. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/RelocateClassesTask$run$9$1.class +0 -0
  39. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/RelocateClassesTask$run$remapper$1.class +0 -0
  40. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/RelocateClassesTask.class +0 -0
  41. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/RelocationKt$memberReferences$1$visitMethod$1.class +0 -0
  42. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/RelocationKt$memberReferences$1.class +0 -0
  43. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/RelocationKt$referencedClasses$collector$1.class +0 -0
  44. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/RelocationKt$shareNonPublicDependents$Declared.class +0 -0
  45. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/RelocationKt.class +0 -0
  46. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  47. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  48. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  49. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
  50. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  51. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
  52. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  53. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  54. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  55. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  56. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  57. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  58. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  59. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  60. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  61. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  62. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  63. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  64. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
  65. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
  66. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
  67. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
  68. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
  69. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
  70. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
  71. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  72. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  73. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  74. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  75. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  76. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  77. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab +0 -0
  78. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream +0 -0
  79. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len +0 -0
  80. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.len +0 -0
  81. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at +0 -0
  82. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i +0 -0
  83. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  84. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  85. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  86. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  87. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  88. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  89. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  90. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  91. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  92. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  93. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  94. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  95. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  96. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  97. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  98. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  99. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  100. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
  101. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
  102. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  103. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  104. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  105. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  106. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  107. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  108. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
  109. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/counters.tab +1 -1
  110. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  111. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  112. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  113. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
  114. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  115. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
  116. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  117. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  118. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  119. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  120. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  121. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  122. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  123. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  124. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  125. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  126. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  127. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  128. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/last-build.bin +0 -0
  129. package/espresso-server/buildSrc/build/kotlin/compileKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
  130. package/espresso-server/buildSrc/build/libs/buildSrc.jar +0 -0
  131. package/espresso-server/buildSrc/build.gradle.kts +6 -0
  132. package/espresso-server/buildSrc/src/main/kotlin/io/appium/espressoserver/gradle/RelocateClassesTask.kt +141 -0
  133. package/espresso-server/buildSrc/src/main/kotlin/io/appium/espressoserver/gradle/Relocation.kt +342 -0
  134. package/espresso-server/buildSrc/src/test/kotlin/io/appium/espressoserver/gradle/RelocationTest.kt +186 -0
  135. package/espresso-server/library/src/main/java/io/appium/espressoserver/lib/handlers/ListIdlingResources.kt +2 -1
  136. package/espresso-server/library/src/main/java/io/appium/espressoserver/lib/helpers/ShadingHelpers.kt +45 -0
  137. package/espresso-server/library/src/main/java/io/appium/espressoserver/lib/helpers/Version.kt +1 -1
  138. package/espresso-server/library/src/main/java/io/appium/espressoserver/lib/http/response/AppiumResponse.kt +3 -2
  139. package/espresso-server/library/src/main/java/io/appium/espressoserver/lib/model/HamcrestMatcher.kt +8 -5
  140. package/espresso-server/library/src/test/java/io/appium/espressoserver/test/helpers/ShadingHelpersTest.kt +37 -0
  141. package/lib/commands/orientation.ts +49 -0
  142. package/lib/commands/server/builder.ts +29 -0
  143. package/lib/commands/server/hints.ts +69 -0
  144. package/lib/commands/server/runner.ts +53 -5
  145. package/lib/driver.ts +14 -0
  146. package/node_modules/appium-adb/CHANGELOG.md +7 -0
  147. package/node_modules/appium-adb/package.json +3 -3
  148. package/node_modules/appium-android-driver/CHANGELOG.md +74 -0
  149. package/node_modules/appium-android-driver/build/lib/commands/bidi/helpers.d.ts +10 -0
  150. package/node_modules/appium-android-driver/build/lib/commands/bidi/helpers.d.ts.map +1 -0
  151. package/node_modules/appium-android-driver/build/lib/commands/bidi/helpers.js +15 -0
  152. package/node_modules/appium-android-driver/build/lib/commands/bidi/helpers.js.map +1 -0
  153. package/node_modules/appium-android-driver/build/lib/commands/bidi/logcat-level.d.ts +9 -0
  154. package/node_modules/appium-android-driver/build/lib/commands/bidi/logcat-level.d.ts.map +1 -0
  155. package/node_modules/appium-android-driver/build/lib/commands/bidi/logcat-level.js +37 -0
  156. package/node_modules/appium-android-driver/build/lib/commands/bidi/logcat-level.js.map +1 -0
  157. package/node_modules/appium-android-driver/build/lib/commands/device/common.d.ts.map +1 -1
  158. package/node_modules/appium-android-driver/build/lib/commands/device/common.js +2 -0
  159. package/node_modules/appium-android-driver/build/lib/commands/device/common.js.map +1 -1
  160. package/node_modules/appium-android-driver/build/lib/commands/find.js +2 -2
  161. package/node_modules/appium-android-driver/build/lib/commands/find.js.map +1 -1
  162. package/node_modules/appium-android-driver/build/lib/commands/log.d.ts +4 -0
  163. package/node_modules/appium-android-driver/build/lib/commands/log.d.ts.map +1 -1
  164. package/node_modules/appium-android-driver/build/lib/commands/log.js +7 -1
  165. package/node_modules/appium-android-driver/build/lib/commands/log.js.map +1 -1
  166. package/node_modules/appium-android-driver/build/lib/commands/media-stream/constants.d.ts +3 -0
  167. package/node_modules/appium-android-driver/build/lib/commands/media-stream/constants.d.ts.map +1 -1
  168. package/node_modules/appium-android-driver/build/lib/commands/media-stream/constants.js +4 -0
  169. package/node_modules/appium-android-driver/build/lib/commands/media-stream/constants.js.map +1 -1
  170. package/node_modules/appium-android-driver/build/lib/commands/media-stream/exports.d.ts +10 -4
  171. package/node_modules/appium-android-driver/build/lib/commands/media-stream/exports.d.ts.map +1 -1
  172. package/node_modules/appium-android-driver/build/lib/commands/media-stream/exports.js +38 -20
  173. package/node_modules/appium-android-driver/build/lib/commands/media-stream/exports.js.map +1 -1
  174. package/node_modules/appium-android-driver/build/lib/commands/media-stream/stream.d.ts +34 -2
  175. package/node_modules/appium-android-driver/build/lib/commands/media-stream/stream.d.ts.map +1 -1
  176. package/node_modules/appium-android-driver/build/lib/commands/media-stream/stream.js +89 -43
  177. package/node_modules/appium-android-driver/build/lib/commands/media-stream/stream.js.map +1 -1
  178. package/node_modules/appium-android-driver/build/lib/driver.d.ts +5 -0
  179. package/node_modules/appium-android-driver/build/lib/driver.d.ts.map +1 -1
  180. package/node_modules/appium-android-driver/build/lib/driver.js +1 -0
  181. package/node_modules/appium-android-driver/build/lib/driver.js.map +1 -1
  182. package/node_modules/appium-android-driver/build/lib/execute-method-map.d.ts +4 -0
  183. package/node_modules/appium-android-driver/build/lib/execute-method-map.d.ts.map +1 -1
  184. package/node_modules/appium-android-driver/build/lib/execute-method-map.js +5 -0
  185. package/node_modules/appium-android-driver/build/lib/execute-method-map.js.map +1 -1
  186. package/node_modules/appium-android-driver/lib/commands/bidi/helpers.ts +16 -0
  187. package/node_modules/appium-android-driver/lib/commands/bidi/logcat-level.ts +40 -0
  188. package/node_modules/appium-android-driver/lib/commands/device/common.ts +2 -0
  189. package/node_modules/appium-android-driver/lib/commands/find.ts +2 -2
  190. package/node_modules/appium-android-driver/lib/commands/log.ts +9 -1
  191. package/node_modules/appium-android-driver/lib/commands/media-stream/constants.ts +4 -0
  192. package/node_modules/appium-android-driver/lib/commands/media-stream/exports.ts +46 -21
  193. package/node_modules/appium-android-driver/lib/commands/media-stream/stream.ts +90 -43
  194. package/node_modules/appium-android-driver/lib/driver.ts +1 -0
  195. package/node_modules/appium-android-driver/lib/execute-method-map.ts +6 -0
  196. package/node_modules/appium-android-driver/package.json +6 -6
  197. package/node_modules/appium-chromedriver/CHANGELOG.md +7 -0
  198. package/node_modules/appium-chromedriver/config/mapping.json +1 -0
  199. package/node_modules/appium-chromedriver/package.json +2 -2
  200. package/node_modules/asyncbox/README.md +7 -3
  201. package/node_modules/asyncbox/build/lib/shared/errors.d.ts +18 -2
  202. package/node_modules/asyncbox/build/lib/shared/errors.d.ts.map +1 -1
  203. package/node_modules/asyncbox/build/lib/shared/errors.js +24 -8
  204. package/node_modules/asyncbox/build/lib/shared/errors.js.map +1 -1
  205. package/node_modules/asyncbox/lib/shared/errors.ts +34 -8
  206. package/node_modules/asyncbox/package.json +1 -1
  207. package/node_modules/bare-buffer/CMakeLists.txt +3 -3
  208. package/node_modules/bare-buffer/package.json +1 -1
  209. package/node_modules/bare-buffer/prebuilds/android-arm/bare-buffer.bare +0 -0
  210. package/node_modules/bare-buffer/prebuilds/android-arm64/bare-buffer.bare +0 -0
  211. package/node_modules/bare-buffer/prebuilds/android-ia32/bare-buffer.bare +0 -0
  212. package/node_modules/bare-buffer/prebuilds/android-x64/bare-buffer.bare +0 -0
  213. package/node_modules/bare-buffer/prebuilds/darwin-arm64/bare-buffer.bare +0 -0
  214. package/node_modules/bare-buffer/prebuilds/darwin-x64/bare-buffer.bare +0 -0
  215. package/node_modules/bare-buffer/prebuilds/ios-arm64/bare-buffer.bare +0 -0
  216. package/node_modules/bare-buffer/prebuilds/ios-arm64-simulator/bare-buffer.bare +0 -0
  217. package/node_modules/bare-buffer/prebuilds/ios-x64-simulator/bare-buffer.bare +0 -0
  218. package/node_modules/bare-buffer/prebuilds/linux-arm64/bare-buffer.bare +0 -0
  219. package/node_modules/bare-buffer/prebuilds/linux-x64/bare-buffer.bare +0 -0
  220. package/node_modules/bare-buffer/prebuilds/win32-arm64/bare-buffer.bare +0 -0
  221. package/node_modules/bare-buffer/prebuilds/win32-x64/bare-buffer.bare +0 -0
  222. package/node_modules/bare-fs/package.json +2 -2
  223. package/node_modules/bare-fs/prebuilds/android-arm/bare-fs.bare +0 -0
  224. package/node_modules/bare-fs/prebuilds/android-arm64/bare-fs.bare +0 -0
  225. package/node_modules/bare-fs/prebuilds/android-ia32/bare-fs.bare +0 -0
  226. package/node_modules/bare-fs/prebuilds/android-x64/bare-fs.bare +0 -0
  227. package/node_modules/bare-fs/prebuilds/darwin-arm64/bare-fs.bare +0 -0
  228. package/node_modules/bare-fs/prebuilds/darwin-x64/bare-fs.bare +0 -0
  229. package/node_modules/bare-fs/prebuilds/ios-arm64/bare-fs.bare +0 -0
  230. package/node_modules/bare-fs/prebuilds/ios-arm64-simulator/bare-fs.bare +0 -0
  231. package/node_modules/bare-fs/prebuilds/ios-x64-simulator/bare-fs.bare +0 -0
  232. package/node_modules/bare-fs/prebuilds/linux-arm64/bare-fs.bare +0 -0
  233. package/node_modules/bare-fs/prebuilds/linux-x64/bare-fs.bare +0 -0
  234. package/node_modules/bare-fs/prebuilds/win32-arm64/bare-fs.bare +0 -0
  235. package/node_modules/bare-fs/prebuilds/win32-x64/bare-fs.bare +0 -0
  236. package/node_modules/bare-url/CMakeLists.txt +5 -5
  237. package/node_modules/bare-url/package.json +1 -1
  238. package/node_modules/bare-url/prebuilds/android-arm/bare-url.bare +0 -0
  239. package/node_modules/bare-url/prebuilds/android-arm64/bare-url.bare +0 -0
  240. package/node_modules/bare-url/prebuilds/android-ia32/bare-url.bare +0 -0
  241. package/node_modules/bare-url/prebuilds/android-x64/bare-url.bare +0 -0
  242. package/node_modules/bare-url/prebuilds/darwin-arm64/bare-url.bare +0 -0
  243. package/node_modules/bare-url/prebuilds/darwin-x64/bare-url.bare +0 -0
  244. package/node_modules/bare-url/prebuilds/ios-arm64/bare-url.bare +0 -0
  245. package/node_modules/bare-url/prebuilds/ios-arm64-simulator/bare-url.bare +0 -0
  246. package/node_modules/bare-url/prebuilds/ios-x64-simulator/bare-url.bare +0 -0
  247. package/node_modules/bare-url/prebuilds/linux-arm64/bare-url.bare +0 -0
  248. package/node_modules/bare-url/prebuilds/linux-x64/bare-url.bare +0 -0
  249. package/node_modules/bare-url/prebuilds/win32-arm64/bare-url.bare +0 -0
  250. package/node_modules/bare-url/prebuilds/win32-x64/bare-url.bare +0 -0
  251. package/node_modules/ini/package.json +5 -5
  252. package/node_modules/io.appium.settings/CHANGELOG.md +21 -0
  253. package/node_modules/io.appium.settings/apks/settings_apk-debug.apk +0 -0
  254. package/node_modules/io.appium.settings/package.json +3 -3
  255. package/node_modules/plist/dist/parse-binary.d.ts.map +1 -1
  256. package/node_modules/plist/dist/parse-binary.js +37 -9
  257. package/node_modules/plist/dist/parse-binary.js.map +1 -1
  258. package/node_modules/plist/package.json +1 -1
  259. package/package.json +5 -5
  260. package/scripts/check-shaded-packages.mjs +106 -0
  261. package/scripts/lib/dependency-versions/apk-meta-inf.mjs +0 -13
  262. package/scripts/lib/dependency-versions/comparison.mjs +17 -47
  263. package/scripts/lib/dependency-versions/gradle-scan.mjs +77 -87
  264. package/scripts/lib/dependency-versions/index.mjs +1 -1
  265. package/scripts/lib/dependency-versions/report.mjs +4 -4
  266. package/scripts/lib/dependency-versions/tracked-modules.mjs +2 -42
  267. package/scripts/lib/dependency-versions/types.mjs +2 -1
  268. package/scripts/lib/dependency-versions/version-utils.mjs +124 -2
  269. package/scripts/lib/diagnose/app-input.mjs +4 -1
  270. package/scripts/lib/diagnose/checks/compile-sdk.mjs +6 -2
  271. package/scripts/lib/diagnose/checks/dependency.mjs +1 -1
  272. package/scripts/lib/diagnose/checks/index.mjs +0 -3
  273. package/scripts/lib/diagnose/checks/obfuscation.mjs +1 -1
  274. package/scripts/lib/diagnose/diagnosis.mjs +2 -7
  275. package/scripts/lib/diagnose/report.mjs +2 -2
  276. package/scripts/lib/diagnose/checks/androidx.mjs +0 -40
  277. package/scripts/lib/diagnose/checks/lifecycle-extensions.mjs +0 -23
  278. package/scripts/lib/diagnose/checks/startup-provider.mjs +0 -41
@@ -3,13 +3,16 @@ import {errors} from 'appium/driver.js';
3
3
  import type {AndroidDriverConstraints} from '../../constraints.js';
4
4
  import type {AndroidDriver} from '../../driver.js';
5
5
  import {BIDI_EVENT_NAME} from '../bidi/constants.js';
6
+ import {hasSubscribers} from '../bidi/helpers.js';
6
7
  import {getCapabilities, queryVideoEncoders} from './capabilities.js';
7
8
  import {
8
9
  DEFAULT_BATCH_MS,
9
10
  DEFAULT_IDLE_HEARTBEAT_MS,
10
- MEDIA_STREAM_MODULE,
11
+ MAX_BATCH_MS,
12
+ MAX_IDLE_HEARTBEAT_MS,
11
13
  MEDIA_UNITS_EVENT,
12
14
  MIN_API_LEVEL,
15
+ MIN_IDLE_HEARTBEAT_MS,
13
16
  } from './constants.js';
14
17
  import {MediaStream} from './stream.js';
15
18
  import type {MediaKind, MediaStreamCapabilities, MediaStreamInfo, StartMediaStreamOpts} from './types.js';
@@ -30,6 +33,8 @@ declare module '../../driver.js' {
30
33
  * Starts streaming the screen as `appium:mediaStream.*` BiDi events.
31
34
  * Subscribe to `appium:mediaStream` before calling this. The result and the `started` event of a
32
35
  * video stream carry the frame size (after any scaling to the encoder's limits).
36
+ * Only one stream of each kind runs per session. If one of the same kind is still stopping, this
37
+ * waits until its device session is stopped, so the two device sessions never overlap.
33
38
  *
34
39
  * @param kind 'video' (H.264/HEVC, optionally with AAC audio) or 'jpeg'.
35
40
  * @param codec Video codec, 'h264' by default.
@@ -39,8 +44,8 @@ declare module '../../driver.js' {
39
44
  * @param scale JPEG scale in percent, 1-100.
40
45
  * @param resolution Video resolution as 'WxH'.
41
46
  * @param audio Whether to add an AAC audio track (video only).
42
- * @param batchMs Units batching window for video/audio. 40 by default.
43
- * @param idleHeartbeatMs Re-send the last JPEG after this idle time. 1000 by default, 0 disables.
47
+ * @param batchMs Units batching window for video/audio, 0-1000. 40 by default, 0 disables batching.
48
+ * @param idleHeartbeatMs Re-send the last JPEG after this idle time. 1000 by default, 0 disables, otherwise 100-60000.
44
49
  */
45
50
  export async function mobileStartMediaStream(
46
51
  this: AndroidDriver,
@@ -88,17 +93,20 @@ export async function mobileStartMediaStream(
88
93
  }
89
94
  const streams = (this._mediaStreams ??= new Map());
90
95
  const ended = (this._endedMediaStreamIds ??= new Set());
91
- for (const [id, s] of streams) {
92
- if (s.isStopped) {
93
- streams.delete(id);
94
- ended.add(id);
95
- }
96
+ let stopping: MediaStream | undefined;
97
+ while ((stopping = [...streams.values()].find((s) => s.kind === kind && s.isStopped))) {
98
+ await stopping.stop();
99
+ }
100
+ let returned = false;
101
+ if (this._mediaStreamsClosed) {
102
+ throw new errors.NoSuchDriverError('The session was deleted while the media stream was starting');
96
103
  }
97
104
  if ([...streams.values()].some((s) => s.kind === kind)) {
98
105
  throw new errors.InvalidArgumentError(`A ${kind} media stream is already running in this session`);
99
106
  }
100
107
 
101
- // No await between the check above and the registration below, or concurrent starts could both pass
108
+ // No await between the checks above and the registration below, or concurrent starts could both
109
+ // pass, or a start could register a stream that session deletion no longer stops
102
110
  const session =
103
111
  kind === 'video' ? this.settingsApp.makeVideoStreamSession() : this.settingsApp.makeJpegStreamSession();
104
112
  const stream = new MediaStream(session, opts, {
@@ -110,15 +118,20 @@ export async function mobileStartMediaStream(
110
118
  emitter: this.eventEmitter,
111
119
  hasSubscribers: () => hasSubscribers(this, MEDIA_UNITS_EVENT),
112
120
  log: this.log,
113
- // Ended streams are moved to the ended ids on the next start, see mobileStopMediaStream
114
- onEnded: () => {},
121
+ onEnded: (id) => {
122
+ streams.delete(id);
123
+ if (returned) {
124
+ ended.add(id);
125
+ }
126
+ },
115
127
  });
116
128
  streams.set(stream.streamId, stream);
117
129
  try {
118
130
  await this.settingsApp.adjustMediaProjectionServicePermissions();
119
- return await stream.start();
131
+ const info = await stream.start();
132
+ returned = true;
133
+ return info;
120
134
  } catch (e) {
121
- streams.delete(stream.streamId);
122
135
  await stream.stop('failed to start');
123
136
  throw e instanceof TypeError || e instanceof RangeError ? new errors.InvalidArgumentError(e.message) : e;
124
137
  }
@@ -133,7 +146,8 @@ export async function mobileGetMediaStreamCapabilities(this: AndroidDriver): Pro
133
146
  }
134
147
 
135
148
  /**
136
- * Stops a media stream started by `mobile: startMediaStream`.
149
+ * Stops a media stream started by `mobile: startMediaStream`, and resolves once its device session
150
+ * is stopped, also if it was already stopping.
137
151
  * Stopping a stream that has already ended is a no-op, also after other streams were started.
138
152
  *
139
153
  * @param streamId The id returned by `mobile: startMediaStream`.
@@ -147,15 +161,15 @@ export async function mobileStopMediaStream(this: AndroidDriver, streamId: strin
147
161
  }
148
162
  }
149
163
 
150
- /** Stops all streams of the session; used on session deletion. */
164
+ /**
165
+ * Stops all streams of the session, also waiting for those still stopping, and rejects starts
166
+ * that have not registered their stream yet; used on session deletion.
167
+ */
151
168
  export async function stopAllMediaStreams(this: AndroidDriver): Promise<void> {
169
+ this._mediaStreamsClosed = true;
152
170
  await Promise.all([...(this._mediaStreams?.values() ?? [])].map((s) => s.stop('session ended')));
153
171
  }
154
172
 
155
- function hasSubscribers(driver: AndroidDriver, method: string): boolean {
156
- return [method, MEDIA_STREAM_MODULE].some((e) => (driver.bidiEventSubs[e]?.length ?? 0) > 0);
157
- }
158
-
159
173
  function validateOpts({
160
174
  kind,
161
175
  codec,
@@ -176,7 +190,18 @@ function validateOpts({
176
190
  `${offending.map(([k]) => `'${k}'`).join(', ')} not supported for kind '${kind}'`,
177
191
  );
178
192
  }
179
- if (!Number.isInteger(batchMs) || batchMs < 0 || !Number.isInteger(idleHeartbeatMs) || idleHeartbeatMs < 0) {
180
- throw new errors.InvalidArgumentError(`'batchMs' and 'idleHeartbeatMs' must be non-negative integers`);
193
+ if (!Number.isInteger(batchMs) || batchMs < 0 || batchMs > MAX_BATCH_MS) {
194
+ throw new errors.InvalidArgumentError(
195
+ `'batchMs' must be an integer between 0 and ${MAX_BATCH_MS}, got '${String(batchMs)}'`,
196
+ );
197
+ }
198
+ if (
199
+ !Number.isInteger(idleHeartbeatMs) ||
200
+ (idleHeartbeatMs !== 0 && (idleHeartbeatMs < MIN_IDLE_HEARTBEAT_MS || idleHeartbeatMs > MAX_IDLE_HEARTBEAT_MS))
201
+ ) {
202
+ throw new errors.InvalidArgumentError(
203
+ `'idleHeartbeatMs' must be 0 or an integer between ${MIN_IDLE_HEARTBEAT_MS} and ${MAX_IDLE_HEARTBEAT_MS}, ` +
204
+ `got '${String(idleHeartbeatMs)}'`,
205
+ );
181
206
  }
182
207
  }
@@ -43,6 +43,7 @@ export class MediaStream {
43
43
  private videoSynced = false;
44
44
  private wasSubscribed = false;
45
45
  private lastKeyFrameRequestAt = 0;
46
+ private keyFrameRetry?: NodeJS.Timeout;
46
47
  private jpegSeq = 0;
47
48
  private lastJpeg?: MediaUnit;
48
49
  private lastJpegEmitAt = 0;
@@ -50,13 +51,19 @@ export class MediaStream {
50
51
  private dropped = 0;
51
52
  private heartbeat?: NodeJS.Timeout;
52
53
  private pump?: Promise<void>;
53
- // Whether the device-side session is ours to stop (false if another client's stream was found running)
54
- private owned = false;
54
+ /**
55
+ * Settles once the device session is up or failed to start, telling whether there is a device
56
+ * session of ours to stop. False if another client's stream of this kind was found running, or if
57
+ * the options were rejected (TypeError, RangeError) before the device was touched. Any other
58
+ * failure may have brought the on-device service up, so it counts as ours.
59
+ */
60
+ private deviceStart?: Promise<boolean>;
55
61
  private announced = false;
56
62
  private endReason = 'ended';
57
63
  private firstUnitSeen!: () => void;
58
64
  private readonly firstUnit = new Promise<void>((resolve) => (this.firstUnitSeen = resolve));
59
65
  private stopped = false;
66
+ private finished?: Promise<void>;
60
67
  private get videoChain(): string {
61
68
  return `${this.streamId}:video`;
62
69
  }
@@ -70,46 +77,40 @@ export class MediaStream {
70
77
  this.batcher = new UnitBatcher(opts.kind === 'jpeg' ? 0 : opts.batchMs, (units) => this.emitUnits(units));
71
78
  }
72
79
 
80
+ /**
81
+ * Starts the device session and republishes its units.
82
+ * Throws if another client's stream of this kind runs on the device, which is left alone.
83
+ * If the stream is stopped while the device session is starting, this throws and the teardown
84
+ * stops the device session once it is up.
85
+ */
73
86
  async start(): Promise<MediaStreamInfo> {
74
87
  const {opts} = this;
75
88
  if (this.stopped) {
76
89
  throw new Error('The stream was stopped before it started');
77
90
  }
78
- // A start() that throws may still have brought the on-device service up, so it is ours
79
- this.owned = true;
80
- let started: boolean;
81
- try {
82
- started =
83
- opts.kind === 'video'
84
- ? await (this.session as VideoStreamSession).start({
85
- codec: opts.codec,
86
- fps: opts.fps,
87
- bitrate: opts.bitrate,
88
- resolution: opts.resolution,
89
- audio: opts.audio,
90
- })
91
- : await (this.session as JpegStreamSession).start({fps: opts.fps, quality: opts.quality, scale: opts.scale});
92
- } catch (e) {
93
- // Option validation runs before the device is touched, so there is nothing of ours to stop
94
- if (e instanceof TypeError || e instanceof RangeError) {
95
- this.owned = false;
96
- }
97
- if (this.owned && this.stopped) {
98
- // finish() already ran and skipped the device session, which may be half up
99
- await this.session.stop().catch(() => {});
91
+ const starting =
92
+ opts.kind === 'video'
93
+ ? (this.session as VideoStreamSession).start({
94
+ codec: opts.codec,
95
+ fps: opts.fps,
96
+ bitrate: opts.bitrate,
97
+ resolution: opts.resolution,
98
+ audio: opts.audio,
99
+ })
100
+ : (this.session as JpegStreamSession).start({fps: opts.fps, quality: opts.quality, scale: opts.scale});
101
+ this.deviceStart = (async () => {
102
+ try {
103
+ return await starting;
104
+ } catch (e) {
105
+ return !(e instanceof TypeError || e instanceof RangeError);
100
106
  }
101
- throw e;
107
+ })();
108
+ if (!(await starting)) {
109
+ throw new Error(`Another ${opts.kind} stream is already running on the device`);
102
110
  }
103
111
  if (this.stopped) {
104
- // Stopped while the device session was starting: finish() may have run before it was up
105
- await this.session.stop().catch(() => {});
106
112
  throw new Error('The stream was stopped while it was starting');
107
113
  }
108
- if (!started) {
109
- // The device already runs a stream of this kind that is not ours: leave it alone
110
- this.owned = false;
111
- throw new Error(`Another ${opts.kind} stream is already running on the device`);
112
- }
113
114
 
114
115
  this.deps.emitter.on(BACKPRESSURE_EVENT_NAME, this.onBackpressure);
115
116
  if (opts.kind === 'jpeg' && opts.idleHeartbeatMs > 0) {
@@ -164,22 +165,39 @@ export class MediaStream {
164
165
  return this.stopped;
165
166
  }
166
167
 
167
- /** Idempotent; resolves once the stream is torn down and its pump has finished. */
168
+ /**
169
+ * Idempotent: every call waits for the same teardown, and resolves once the device session of
170
+ * the stream is stopped (after its start settled, if it was still starting) and the pump has
171
+ * finished. Never rejects.
172
+ */
168
173
  async stop(reason = 'stopped'): Promise<void> {
169
174
  await this.finish(reason);
170
175
  await this.pump?.catch(() => {});
171
176
  }
172
177
 
173
- // Must not await the pump: it is also called from inside the pump itself
174
- private async finish(reason: string): Promise<void> {
175
- if (this.stopped) {
176
- return;
177
- }
178
+ /**
179
+ * Marks the stream stopped and returns its single teardown.
180
+ * Must not await the pump: it is also called from inside the pump itself.
181
+ */
182
+ private finish(reason: string): Promise<void> {
178
183
  this.stopped = true;
184
+ return (this.finished ??= this.teardown(reason));
185
+ }
186
+
187
+ /**
188
+ * Waits for a device start that is still in flight (a starting device session can only be
189
+ * stopped once it is up), stops the device session if it is ours, emits `ended`, and calls
190
+ * `onEnded`. Never rejects: the stream is ended whatever its device session or a listener of
191
+ * `ended` does, so failures of either are logged, not passed to the callers of stop().
192
+ * It awaits before running any callback, so finish() has stored it by the time a callback stops
193
+ * the stream again, and that call gets this same teardown.
194
+ */
195
+ private async teardown(reason: string): Promise<void> {
179
196
  clearInterval(this.heartbeat);
197
+ this.cancelKeyFrameRetry();
180
198
  this.batcher.close();
181
199
  this.deps.emitter.off(BACKPRESSURE_EVENT_NAME, this.onBackpressure);
182
- if (this.owned) {
200
+ if (await this.deviceStart) {
183
201
  try {
184
202
  await this.session.stop();
185
203
  } catch (e) {
@@ -187,7 +205,11 @@ export class MediaStream {
187
205
  }
188
206
  }
189
207
  if (this.announced) {
190
- this.deps.emit({method: MEDIA_ENDED_EVENT, params: {streamId: this.streamId, reason}});
208
+ try {
209
+ this.deps.emit({method: MEDIA_ENDED_EVENT, params: {streamId: this.streamId, reason}});
210
+ } catch (e) {
211
+ this.deps.log.warn(`Cannot emit the end of the ${this.kind} stream: ${(e as Error).message}`);
212
+ }
191
213
  }
192
214
  this.deps.onEnded(this.streamId);
193
215
  }
@@ -266,6 +288,8 @@ export class MediaStream {
266
288
  if (au.track === 'video') {
267
289
  if (au.isKeyFrame) {
268
290
  this.videoSynced = true;
291
+ // The subscribers get a keyframe now, so a request still waiting for the rate limit is not needed
292
+ this.cancelKeyFrameRetry();
269
293
  unit.data = this.config ? Buffer.concat([this.config, au.data]) : au.data;
270
294
  } else if (!this.videoSynced) {
271
295
  return;
@@ -350,15 +374,38 @@ export class MediaStream {
350
374
  });
351
375
  }
352
376
 
377
+ // At most one request per interval. A request that comes sooner is sent once the interval has passed,
378
+ // unless a keyframe reaches the subscribers first
353
379
  private requestKeyFrame(): void {
354
- const now = Date.now();
355
- if (this.kind !== 'video' || now - this.lastKeyFrameRequestAt < KEYFRAME_REQUEST_MIN_INTERVAL_MS) {
380
+ if (this.stopped || this.kind !== 'video') {
356
381
  return;
357
382
  }
358
- this.lastKeyFrameRequestAt = now;
383
+ const elapsed = Date.now() - this.lastKeyFrameRequestAt;
384
+ // A negative value means the clock was set back, which must not hold requests back until it catches up
385
+ if (elapsed >= 0 && elapsed < KEYFRAME_REQUEST_MIN_INTERVAL_MS) {
386
+ this.keyFrameRetry ??= setTimeout(() => {
387
+ this.keyFrameRetry = undefined;
388
+ if (this.deps.hasSubscribers()) {
389
+ this.requestKeyFrame();
390
+ } else {
391
+ // Nobody is left to get the keyframe. A subscriber that comes back before the next unit
392
+ // is a late joiner too, so reset what that unit would have reset
393
+ this.wasSubscribed = false;
394
+ this.videoSynced = false;
395
+ }
396
+ }, KEYFRAME_REQUEST_MIN_INTERVAL_MS - elapsed);
397
+ return;
398
+ }
399
+ this.cancelKeyFrameRetry();
400
+ this.lastKeyFrameRequestAt = Date.now();
359
401
  void this.sendKeyFrameRequest();
360
402
  }
361
403
 
404
+ private cancelKeyFrameRetry(): void {
405
+ clearTimeout(this.keyFrameRetry);
406
+ this.keyFrameRetry = undefined;
407
+ }
408
+
362
409
  private async sendKeyFrameRequest(): Promise<void> {
363
410
  try {
364
411
  const sent = await (this.session as VideoStreamSession).requestKeyFrame();
@@ -267,6 +267,7 @@ class AndroidDriver<C extends AndroidDriverConstraints = AndroidDriverConstraint
267
267
  _screenStreamingProps?: ScreenStreamingProps;
268
268
  _mediaStreams?: Map<string, MediaStream>;
269
269
  _endedMediaStreamIds?: Set<string>;
270
+ _mediaStreamsClosed?: boolean;
270
271
  _screenRecordingProperties?: ScreenRecordingProperties;
271
272
  _logcatWebsocketListener?: LogcatListener;
272
273
  _bidiServerLogListener?: (...args: any[]) => void;
@@ -14,6 +14,8 @@ const INTENT_PARAMS = [
14
14
  'flags',
15
15
  ] as const;
16
16
 
17
+ const LOGS_BROADCAST_DEPRECATION_INFO = `Use the BiDi 'log.entryAdded' event (requires the 'webSocketUrl' capability) to receive logs instead.`;
18
+
17
19
  export const executeMethodMap = {
18
20
  'mobile: shell': {
19
21
  command: 'mobileShell',
@@ -33,9 +35,13 @@ export const executeMethodMap = {
33
35
 
34
36
  'mobile: startLogsBroadcast': {
35
37
  command: 'mobileStartLogsBroadcast',
38
+ deprecated: true,
39
+ info: LOGS_BROADCAST_DEPRECATION_INFO,
36
40
  },
37
41
  'mobile: stopLogsBroadcast': {
38
42
  command: 'mobileStopLogsBroadcast',
43
+ deprecated: true,
44
+ info: LOGS_BROADCAST_DEPRECATION_INFO,
39
45
  },
40
46
 
41
47
  'mobile: changePermissions': {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium-android-driver",
3
- "version": "15.2.2",
3
+ "version": "15.4.6",
4
4
  "description": "Android UiAutomator and Chrome support for Appium",
5
5
  "keywords": [
6
6
  "android",
@@ -50,12 +50,12 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@appium/support": "^8.0.0-beta.7",
53
- "appium-adb": "^17.0.3",
54
- "appium-chromedriver": "^10.0.5",
55
- "asyncbox": "^7.0.0",
53
+ "appium-adb": "^17.0.4",
54
+ "appium-chromedriver": "^10.0.6",
55
+ "asyncbox": "^7.1.0",
56
56
  "axios": "^1.18.0",
57
57
  "dayjs": "^1.11.21",
58
- "io.appium.settings": "^9.2.0",
58
+ "io.appium.settings": "^9.2.3",
59
59
  "lru-cache": "^11.1.0",
60
60
  "semver": "^7.0.0",
61
61
  "teen_process": "^5.0.0",
@@ -77,5 +77,5 @@
77
77
  "node": "^22.22.2 || ^24.15.0 || >=26.0.0",
78
78
  "npm": ">=10"
79
79
  },
80
- "gitHead": "bb346d07e98f1ba3e975e2746422882f287db633"
80
+ "gitHead": "157a2bd77f17080ada6df097df2cf10a19e00ed1"
81
81
  }
@@ -3,6 +3,13 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [10.0.6](https://github.com/appium/appium-android/compare/appium-chromedriver@10.0.5...appium-chromedriver@10.0.6) (2026-11-18)
7
+
8
+ ### Miscellaneous Chores
9
+
10
+ * **chromedriver:** ChromeDriver Bump to v158.0.8127.36 ([#128](https://github.com/appium/appium-android/issues/128)) ([53ba1ca](https://github.com/appium/appium-android/commit/53ba1ca2583b6fd24b5fc06f50d4e8dda49fa418))
11
+
12
+
6
13
  ## [10.0.5](https://github.com/appium/appium-android/compare/appium-chromedriver@10.0.4...appium-chromedriver@10.0.5) (2026-11-14)
7
14
 
8
15
  ### Miscellaneous Chores
@@ -1,4 +1,5 @@
1
1
  {
2
+ "158.0.8127.36": "158.0.8127.36",
2
3
  "157.0.8103.78": "157.0.8103.78",
3
4
  "157.0.8103.50": "157.0.8103.50",
4
5
  "157.0.8103.38": "157.0.8103.38",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium-chromedriver",
3
- "version": "10.0.5",
3
+ "version": "10.0.6",
4
4
  "description": "Node.js wrapper around chromedriver.",
5
5
  "keywords": [
6
6
  "android",
@@ -67,5 +67,5 @@
67
67
  "node": "^22.22.2 || ^24.15.0 || >=26.0.0",
68
68
  "npm": ">=10"
69
69
  },
70
- "gitHead": "63cd0c757b1a2c7ca5ff05e9000ec86ed470f3b4"
70
+ "gitHead": "dfabcd3b22333d97256953f4beb749911f891339"
71
71
  }
@@ -253,9 +253,13 @@ Times are in ms, up to 2147483647, and `0` means no limit.
253
253
 
254
254
  ### Errors
255
255
 
256
- The built-in errors of this package extend `AsyncboxError` and carry a stable `code`,
257
- so match them by `instanceof` or `err.code` instead of the message text. Caller-supplied
258
- errors (e.g. the `error` option of `waitForCondition`) are passed through as is:
256
+ The built-in errors of this package extend `AsyncboxError` and carry a stable `code`
257
+ (also available as a static property of each class), so match them by `Class.is(err)`
258
+ instead of the message text. Unlike `instanceof`, `is` also matches by `code`, so it works
259
+ for errors created by another copy of this package (e.g. a transitive dependency pinning
260
+ another version). A subclass is recognized by `instanceof` only: `TimeoutError.is` does not
261
+ match a `ConditionUnmetError` of another copy. Caller-supplied errors (e.g. the `error`
262
+ option of `waitForCondition`) are passed through as is:
259
263
 
260
264
  | Class | `code` | Thrown by |
261
265
  | --- | --- | --- |
@@ -1,27 +1,43 @@
1
- /** Base class of the built-in typed errors of this package; match by `instanceof` or {@link AsyncboxError.code}. */
1
+ /** Base class of the built-in typed errors of this package; match by {@link AsyncboxError.is} or `code`. */
2
2
  export declare class AsyncboxError extends Error {
3
- /** Stable machine-readable identifier, e.g. `ERR_ASYNCBOX_TIMEOUT` */
3
+ /** Stable machine-readable identifier of the error class, e.g. `ERR_ASYNCBOX_TIMEOUT` */
4
+ static readonly code: string;
5
+ /** Same as the static `code` of the error class */
4
6
  readonly code: string;
5
7
  constructor(message: string, code?: string);
8
+ /**
9
+ * Whether `err` is an instance of this error class. Unlike a bare `instanceof`, it also
10
+ * matches by `code`, so errors created by another copy of this package are recognized.
11
+ * Subclasses are matched by `instanceof` only, i.e. `TimeoutError.is` does not match a
12
+ * `ConditionUnmetError` created by another copy.
13
+ */
14
+ static is<E extends AsyncboxError>(this: (abstract new (...args: any[]) => E) & {
15
+ code: string;
16
+ }, err: unknown): err is E;
6
17
  }
7
18
  /** Error thrown by {@link withTimeout} when the deadline is exceeded. */
8
19
  export declare class TimeoutError extends AsyncboxError {
20
+ static readonly code: string;
9
21
  constructor(message?: string, code?: string);
10
22
  }
11
23
  /** Thrown by {@link waitForCondition} when the condition is not met in time. */
12
24
  export declare class ConditionUnmetError extends TimeoutError {
25
+ static readonly code = "ERR_ASYNCBOX_CONDITION_UNMET";
13
26
  constructor(message?: string);
14
27
  }
15
28
  /** Thrown by {@link AsyncLock} when a queue, execution or occupation time limit is exceeded. */
16
29
  export declare class LockTimeoutError extends TimeoutError {
30
+ static readonly code = "ERR_ASYNCBOX_LOCK_TIMEOUT";
17
31
  constructor(message?: string);
18
32
  }
19
33
  /** Thrown by {@link AsyncLock} when the queue of a key already holds `maxPending` tasks. */
20
34
  export declare class LockQueueFullError extends AsyncboxError {
35
+ static readonly code = "ERR_ASYNCBOX_LOCK_QUEUE_FULL";
21
36
  constructor(message?: string);
22
37
  }
23
38
  /** Thrown when a promise is cancelled via `cancel`. */
24
39
  export declare class PromiseCancellationError extends AsyncboxError {
40
+ static readonly code = "ERR_ASYNCBOX_CANCELLED";
25
41
  constructor(message?: string);
26
42
  }
27
43
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../lib/shared/errors.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,qBAAa,aAAc,SAAQ,KAAK;IACtC,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,MAAuB;CAK3D;AAED,yEAAyE;AACzE,qBAAa,YAAa,SAAQ,aAAa;gBACjC,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,GAAE,MAA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AChD,gBAAyB,IAAI,+BAA+B;gBAEhD,OAAO,CAAC,EAAE,MAAM;CAI7B;AAED,4FAA4F;AAC5F,qBAAa,kBAAmB,SAAQ,aAAa;IACnD,gBAAyB,IAAI,kCAAkC;gBAEnD,OAAO,CAAC,EAAE,MAAM;CAI7B;AAED,uDAAuD;AACvD,qBAAa,wBAAyB,SAAQ,aAAa;IACzD,gBAAyB,IAAI,4BAA4B;gBAE7C,OAAO,GAAE,MAA4B;CAIlD"}
@@ -1,45 +1,61 @@
1
- /** Base class of the built-in typed errors of this package; match by `instanceof` or {@link AsyncboxError.code}. */
1
+ /** Base class of the built-in typed errors of this package; match by {@link AsyncboxError.is} or `code`. */
2
2
  export class AsyncboxError extends Error {
3
- /** Stable machine-readable identifier, e.g. `ERR_ASYNCBOX_TIMEOUT` */
3
+ /** Stable machine-readable identifier of the error class, e.g. `ERR_ASYNCBOX_TIMEOUT` */
4
+ static code = 'ERR_ASYNCBOX';
5
+ /** Same as the static `code` of the error class */
4
6
  code;
5
- constructor(message, code = 'ERR_ASYNCBOX') {
7
+ constructor(message, code = new.target.code) {
6
8
  super(message);
7
9
  this.name = 'AsyncboxError';
8
10
  this.code = code;
9
11
  }
12
+ /**
13
+ * Whether `err` is an instance of this error class. Unlike a bare `instanceof`, it also
14
+ * matches by `code`, so errors created by another copy of this package are recognized.
15
+ * Subclasses are matched by `instanceof` only, i.e. `TimeoutError.is` does not match a
16
+ * `ConditionUnmetError` created by another copy.
17
+ */
18
+ static is(err) {
19
+ return err instanceof this || (err instanceof Error && err.code === this.code);
20
+ }
10
21
  }
11
22
  /** Error thrown by {@link withTimeout} when the deadline is exceeded. */
12
23
  export class TimeoutError extends AsyncboxError {
13
- constructor(message, code = 'ERR_ASYNCBOX_TIMEOUT') {
24
+ static code = 'ERR_ASYNCBOX_TIMEOUT';
25
+ constructor(message, code) {
14
26
  super(message ?? 'Operation timed out', code);
15
27
  this.name = 'TimeoutError';
16
28
  }
17
29
  }
18
30
  /** Thrown by {@link waitForCondition} when the condition is not met in time. */
19
31
  export class ConditionUnmetError extends TimeoutError {
32
+ static code = 'ERR_ASYNCBOX_CONDITION_UNMET';
20
33
  constructor(message) {
21
- super(message ?? 'Condition unmet', 'ERR_ASYNCBOX_CONDITION_UNMET');
34
+ super(message ?? 'Condition unmet');
22
35
  this.name = 'ConditionUnmetError';
23
36
  }
24
37
  }
25
38
  /** Thrown by {@link AsyncLock} when a queue, execution or occupation time limit is exceeded. */
26
39
  export class LockTimeoutError extends TimeoutError {
40
+ static code = 'ERR_ASYNCBOX_LOCK_TIMEOUT';
27
41
  constructor(message) {
28
- super(message ?? 'Lock timed out', 'ERR_ASYNCBOX_LOCK_TIMEOUT');
42
+ super(message ?? 'Lock timed out');
29
43
  this.name = 'LockTimeoutError';
30
44
  }
31
45
  }
32
46
  /** Thrown by {@link AsyncLock} when the queue of a key already holds `maxPending` tasks. */
33
47
  export class LockQueueFullError extends AsyncboxError {
48
+ static code = 'ERR_ASYNCBOX_LOCK_QUEUE_FULL';
34
49
  constructor(message) {
35
- super(message ?? 'Too many pending tasks in queue', 'ERR_ASYNCBOX_LOCK_QUEUE_FULL');
50
+ super(message ?? 'Too many pending tasks in queue');
36
51
  this.name = 'LockQueueFullError';
37
52
  }
38
53
  }
39
54
  /** Thrown when a promise is cancelled via `cancel`. */
40
55
  export class PromiseCancellationError extends AsyncboxError {
56
+ static code = 'ERR_ASYNCBOX_CANCELLED';
41
57
  constructor(message = 'Promise cancelled') {
42
- super(message, 'ERR_ASYNCBOX_CANCELLED');
58
+ super(message);
43
59
  this.name = 'PromiseCancellationError';
44
60
  }
45
61
  }
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../lib/shared/errors.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC,sEAAsE;IAC7D,IAAI,CAAS;IAEtB,YAAY,OAAe,EAAE,OAAe,cAAc;QACxD,KAAK,CAAC,OAA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