Skip to content

Commit

Permalink
Enable video record through screenrecord binary on Genymotion devices (
Browse files Browse the repository at this point in the history
…#854)

* record video on genymotion devices

* variable naming

---------

Co-authored-by: Anton Malinskiy <anton@malinskiy.com>
  • Loading branch information
kartik1o and Malinskiy authored Nov 14, 2023
1 parent 933ee1c commit 6cff8e2
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,15 @@ abstract class BaseAndroidDevice(
}

private suspend fun detectFeatures(): List<DeviceFeature> {
val hasScreenRecord = when {
val screenRecordSupport = when {
!version.isGreaterOrEqualThan(19) -> false
else -> hasBinary("/system/bin/screenrecord")
}
val videoSupport = hasScreenRecord && manufacturer != "Genymotion"
val screenshotSupport = version.isGreaterOrEqualThan(AndroidVersion.VersionCodes.JELLY_BEAN)

val features = mutableListOf<DeviceFeature>()

if (videoSupport) features.add(DeviceFeature.VIDEO)
if (screenRecordSupport) features.add(DeviceFeature.VIDEO)
if (screenshotSupport) features.add(DeviceFeature.SCREENSHOT)
return features
}
Expand Down

0 comments on commit 6cff8e2

Please sign in to comment.