-
Notifications
You must be signed in to change notification settings - Fork 320
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into FEAT-custom-labels
- Loading branch information
Showing
67 changed files
with
1,014 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,5 @@ bin | |
|
||
.idea | ||
|
||
# media assets | ||
maestro-orchestra/src/test/resources/media/assets/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
maestro-android/src/androidTest/java/dev/mobile/maestro/Media.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package dev.mobile.maestro | ||
|
||
import android.content.ContentValues | ||
import android.provider.MediaStore | ||
import androidx.test.platform.app.InstrumentationRegistry | ||
import java.io.OutputStream | ||
|
||
object MediaStorage { | ||
|
||
fun getOutputStream(mediaName: String, mediaExt: String): OutputStream? { | ||
val uri = when (mediaExt) { | ||
Service.FileType.JPG.ext, | ||
Service.FileType.PNG.ext, | ||
Service.FileType.GIF.ext, | ||
Service.FileType.JPEG.ext -> MediaStore.Images.Media.EXTERNAL_CONTENT_URI | ||
Service.FileType.MP4.ext -> MediaStore.Video.Media.EXTERNAL_CONTENT_URI | ||
else -> throw IllegalStateException("mime .$mediaExt not yet supported") | ||
} | ||
val ext = Service.FileType.values().first { it.ext == mediaExt } | ||
val contentValues = ContentValues() | ||
contentValues.apply { | ||
put(MediaStore.MediaColumns.DISPLAY_NAME, mediaName) | ||
put(MediaStore.MediaColumns.MIME_TYPE, ext.mimeType) | ||
} | ||
val contentResolver = InstrumentationRegistry.getInstrumentation().targetContext.contentResolver | ||
val outputStream = contentResolver.insert(uri, contentValues)?.let { | ||
contentResolver.openOutputStream(it) | ||
} | ||
return outputStream | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
CLI_VERSION=1.31.0 | ||
CLI_VERSION=1.32.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package maestro | ||
|
||
import okio.Source | ||
|
||
class NamedSource(val name: String, val source: Source, val extension: String, val path: String) | ||
|
||
enum class MediaExt(val extName: String) { | ||
PNG("png"), | ||
JPEG("jpeg"), | ||
JPG("jpg"), | ||
GIF("gif"), | ||
MP4("mp4"), | ||
} |
10 changes: 10 additions & 0 deletions
10
maestro-client/src/main/java/maestro/device/DeviceConfigManager.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package maestro.device | ||
|
||
import maestro.Maestro | ||
|
||
class DeviceConfigManager(private val maestro: Maestro) { | ||
|
||
fun resetMedia() { | ||
maestro.removeMedia() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.