Skip to content

StreamVault is a TV-first free IPTV player for Android TV built with Kotlin, Jetpack Compose, Room, Hilt, and Media3.

feat: Enable inclusion of Android resources in unit tests and update lint baseline for dynamic locale changes

David Nashashde72ee00eeab
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index 6fa536a3..0c8aa36b 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -387,6 +387,7 @@ abstract class MergeStartupRulesIntoBaselineProfileTask : DefaultTask() {
testOptions {
animationsDisabled = true
+ unitTests.isIncludeAndroidResources = true
}
lint {
diff --git a/app/src/androidTest/java/com/streamvault/app/navigation/ExternalDownloadsRouteRuntimeTest.kt b/app/src/androidTest/java/com/streamvault/app/navigation/ExternalDownloadsRouteRuntimeTest.kt
index 31362eed..7e9b0589 100644
--- a/app/src/androidTest/java/com/streamvault/app/navigation/ExternalDownloadsRouteRuntimeTest.kt
+++ b/app/src/androidTest/java/com/streamvault/app/navigation/ExternalDownloadsRouteRuntimeTest.kt
@@ -32,8 +32,10 @@ class ExternalDownloadsRouteRuntimeTest {
@Test
fun externalDownloadsRouteOpensInAlreadyRunningActivity() {
- ActivityScenario.launch<MainActivity>(Intent(app, MainActivity::class.java)).use { scenario ->
- scenario.onActivity { activity -> activity.onNewIntent(externalDownloadsIntent()) }
+ ActivityScenario.launch<MainActivity>(Intent(app, MainActivity::class.java)).use {
+ app.startActivity(
+ externalDownloadsIntent().addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
+ )
assertTrue(
"Running activity did not reach Downloads",
diff --git a/app/src/test/resources/robolectric.properties b/app/src/test/resources/robolectric.properties
new file mode 100644
index 00000000..61a01d22
--- /dev/null
+++ b/app/src/test/resources/robolectric.properties
@@ -0,0 +1,3 @@
+# Robolectric 4.15.1 supports up to SDK 35, while the app targets SDK 36.
+# Pin the JVM-test SDK so binary-resource tests can read the merged manifest.
+sdk=35
diff --git a/player/lint-baseline.xml b/player/lint-baseline.xml
index 123e1fcd..c5236e39 100644
--- a/player/lint-baseline.xml
+++ b/player/lint-baseline.xml
@@ -1,6 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 8.10.1" type="baseline" client="gradle" dependencies="false" name="AGP (8.10.1)" variant="all" version="8.10.1">
+ <issue
+ id="AppBundleLocaleChanges"
+ message="Found dynamic locale changes, but did not find corresponding Play Core library calls for downloading languages and splitting by language is not disabled in the `bundle` configuration"
+ errorLine1=" configuration.setLocale(Locale.getDefault())"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/streamvault/player/playback/LiveStartupErrorMessage.kt"
+ line="12"
+ column="5"/>
+ </issue>
+
<issue
id="CustomX509TrustManager"
message="Implementing a custom `X509TrustManager` is error-prone and likely to be insecure. It is likely to disable certificate validation altogether, and is non-trivial to implement correctly without calling Android&apos;s default implementation."
@@ -96,7 +107,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/com/streamvault/player/playback/PlayerMediaSourceFactory.kt"
- line="126"
+ line="181"
column="21"/>
</issue>