IMPORTANT: The file content has been truncated. Status: Showing lines 200-250 of 569 total lines. Action: To read more of the file, you can use the 'start_line' and 'end_line' parameters in a subsequent 'read_file' call. For example, to read the next section of the file, use start_line: 251. --- FILE CONTENT (truncated) --- name.contains("pixel2api33", ignoreCase = true) -> "pixel2api33" else -> null } if (deviceDirName != null) { // Set the host-side directory where GMD will pull files from. getAdditionalTestOutputDir().set( layout.buildDirectory.dir("outputs/managed_device_android_test_additional_output/$testVariant/$deviceDirName"), ) } // AGP does not provide a public DSL to set per-ManagedVirtualDevice instrumentation arguments. // We use reflection to reach into the internal testData property and its instrumentationRunnerArguments map. val getTestDataMethod = javaClass.getMethod("getTestData") val testDataProperty = getTestDataMethod.invoke(this) as org.gradle.api.provider.Property<*> val testData = testDataProperty.get() val getArgsMethod = testData.javaClass.getMethod("getInstrumentationRunnerArguments") @Suppress("UNCHECKED_CAST") val argsProperty = getArgsMethod.invoke(testData) as org.gradle.api.provider.MapProperty // Use putAll(provider) to ensure that the arguments are evaluated specifically for this task instance. // This prevents aliasing/merging issues when AGP shares the underlying property object across tasks. val taskName = name argsProperty.putAll( provider { val map = mutableMapOf() when { taskName.contains("phonePixel6api34", ignoreCase = true) -> { map["package"] = screenshotTestPackage map["additionalTestOutputDir"] = "/sdcard/test-outputs/screenshots" } taskName.contains("tablet7Nexus7api34", ignoreCase = true) -> { map["package"] = screenshotTestPackage map["additionalTestOutputDir"] = "/sdcard/test-outputs/screenshots" } taskName.contains("tablet10PixelTabletApi34", ignoreCase = true) -> { map["package"] = screenshotTestPackage map["additionalTestOutputDir"] = "/sdcard/test-outputs/screenshots" } taskName.contains("pixel2api33", ignoreCase = true) -> { map["notPackage"] = screenshotTestPackage map["additionalTestOutputDir"] = "/sdcard/test-outputs/smoke" } } map }, ) } } tasks.register("generateGmdCoverage") {