Repository navigation
[Android] MediaPicker: Stop overwriting picked source files - #38029
Conversation
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Description Updates the pinned `@microsoft/vally-cli` version used by skill validation and live soak workflows from 0.12.0 to the latest stable release, 0.14.0. Also updates direct lint command examples and makes eval-spec comments version-neutral where the described scoring behavior remains unchanged. ## Validation - Installed Vally 0.14.0 through `.github/scripts/SetupVallyRuntime.sh` - Strict-linted all 16 Vally evaluation specifications with Vally 0.14.0 Co-authored-by: PureWeen <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9e73594e-38bc-4937-80c8-cc054aa890d2
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Description Removes the `IlcTreatWarningsAsErrors=false` workaround and its TODO from the Apple NativeAOT simulator integration test. The linked tracking issue, #19397, was closed after all template trimming warnings were resolved. The dedicated `AOTTemplateTest.PublishNativeAOT` suite also maintains an empty expected-warning baseline for Apple NativeAOT builds, so the simulator run should enforce the default ILC warning policy again. ## Validation - The exact `AppleTemplateTests.RunOniOS_MauiNativeAOT` test compiled and started on Windows, but Windows could not complete the Apple ILC phase because the iOS-simulator NativeAOT runtime pack was unavailable (`MSB3030` for `System.Runtime.InteropServices.RuntimeInformation.dll`). - The Windows `AOTTemplateTest.PublishNativeAOT(... win-arm64)` proxy passed, including its assertion that the complete NativeAOT binlog warning list is empty. Apple-specific ILC/codegen and simulator execution require the macOS CI lanes and will be monitored on this draft PR. Copilot-Session: 37f90cb9-27a1-41b7-b954-95bbbcc9e81e Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
…tforms (#37972) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Description Align BlazorWebView `TizenMauiAssetFileProvider` with other platforms.
…pt 1/10) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tion: wait before tap (refs #37653) (#37999) > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! Workflow artifact: ci-fix Artifact kind: deflake Refs: #37653 Target branch: main Attempt: 1/10 ## Attempt 1 of 10 Wait for the Shell navigation button to be ready before the test taps it. ### Previous attempts (prior commits on this PR) No prior attempts. This attempt differs by adding deterministic synchronization at the first interaction rather than changing product behavior, increasing a timeout, or retrying the test. ## Root cause The CI log reports `ShellContentShouldRespectSafeAreaEdges_After_Navigation` timing out while waiting for the expected element. In `Issue32941.cs`, the test waited for `MainPageLabel` and then immediately tapped `GoToSignOutButton`; the button could still be unavailable while the Shell page finished mounting. Flake class: test-quality ## Why this was flaky The test synchronized on a label that proves the initial page is visible, but not on the separate button it interacts with. In build 1573324 the test failed after 18 seconds and then passed in 3 seconds on retry, which is consistent with that readiness race rather than a deterministic safe-area failure. ## De-flake The test now calls `WaitForElement("GoToSignOutButton")` immediately before `Tap`. No assertion was weakened, no timeout was increased, and no retry attribute was added. ## Fix Add the repository-standard readiness wait for the exact element being tapped. This is the smallest correction to the test interaction and leaves the navigation and safe-area assertions unchanged. ## What is unverified / where I need help - The Android UI test could not be run because this runner has no Android UI-test device rig. - Please confirm on the gated Android UI-test leg that the button wait removes the intermittent navigation timeout while the existing safe-area assertions remain green. ## Validation - Command: `not run because no Android UI-test device rig is available in this runner` - Result: not run ## Evidence - Original failing build (from tracking issue): https://dev.azure.com/dnceng-public/public/_build/results?buildId=1558675 - Latest verified-failing build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1573324 --- Filed by [`ci-status-fix`](https://github.com/dotnet/maui/blob/main/.github/workflows/ci-status-fix.md). This is the single PR for #37653: the workflow watches its own CI and pushes up to **10 attempts on this same PR** (it never opens a second PR). It advances only when the fix's own build settles red and that red is caused by the fix. Comments, reviews, and commits do not transfer ownership; the loop remains autonomous until this PR is closed. Eligible `CHANGES_REQUESTED` reviews are handled through Track C. After 10 attempts it stops and defers to humans. In round 1 a maintainer still needs to comment `/azp run maui-pr` (plus the gated uitests/devicetests legs when relevant) to exercise each new commit. > Generated by [CI Failure Fixer (main)](https://github.com/dotnet/maui/actions/runs/33284777954) · gpt56 · 615.6 AIC · ⌖ 86.4 AIC · ⊞ 31.1K · [◷](https://github.com/search?q=repo%3Adotnet%2Fmaui+%22gh-aw-workflow-id%3A+ci-status-fix%22&type=pullrequests) <!-- gh-aw-agentic-workflow: CI Failure Fixer (main), engine: copilot, model: gpt-5.6-sol, id: 33284777954, workflow_id: ci-status-fix, run: https://github.com/dotnet/maui/actions/runs/33284777954 --> <!-- gh-aw-workflow-id: ci-status-fix --> <!-- gh-aw-workflow-call-id: dotnet/maui/ci-status-fix --> Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 38029Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 38029" |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🟡 Changes recommended
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Backports the Android MediaPicker change that prevents modifying user-selected source files by processing rotation/compression in-memory and writing a single MAUI-owned cache output, with device tests validating the behavior on net10.0.
Changes:
- Replaced in-place rotate/compress logic in Android
MediaPickerflows with a centralizedProcessImagepipeline that writes to a cache-owned temp file and optionally cleans up MAUI-owned temp inputs. - Added
FileSystemUtils.IsMauiOwnedTemporaryFileto safely detect which inputs are safe to delete post-processing. - Added Android device tests covering rotation/compression/no-op behavior, source byte preservation, single terminal output, and owned-temp cleanup.
File summaries
| File | Description |
|---|---|
| src/Essentials/test/DeviceTests/Tests/Android/MediaPicker_Tests.cs | Adds Android device regressions verifying source preservation, single cache output, and owned-temp cleanup. |
| src/Essentials/src/MediaPicker/MediaPicker.android.cs | Routes all Android MediaPicker photo paths through ProcessImage to avoid overwriting source files and to delete only MAUI-owned temp inputs. |
| src/Essentials/src/FileSystem/FileSystemUtils.android.cs | Adds a reliable “MAUI-owned temp file” detector based on the Essentials cache subtree. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
This pull request updates the following dependencies [marker]: <> (Begin:a71c12d9-5aa4-4b46-e2d6-08da0cf8cd95) ## From https://github.com/dotnet/xharness - **Subscription**: [a71c12d9-5aa4-4b46-e2d6-08da0cf8cd95](https://maestro.dot.net/subscriptions?search=a71c12d9-5aa4-4b46-e2d6-08da0cf8cd95) - **Build**: [20260828.1](https://dev.azure.com/dnceng/internal/_build/results?buildId=3060005) ([329158](https://maestro.dot.net/channel/2/github:dotnet:xharness/build/329158)) - **Date Produced**: August 28, 2026 2:17:22 PM UTC - **Commit**: [b355c0507b19670c2d386677d7f99260f07cefa5](dotnet/xharness@b355c05) - **Branch**: [main](https://github.com/dotnet/xharness/tree/main) [DependencyUpdate]: <> (Begin) - **Dependency Updates**: - From [11.0.0-prerelease.26419.1 to 11.0.0-prerelease.26428.1][1] - Microsoft.DotNet.XHarness.CLI - Microsoft.DotNet.XHarness.TestRunners.Common - Microsoft.DotNet.XHarness.TestRunners.Xunit [1]: dotnet/xharness@8dd9b8e...b355c05 [DependencyUpdate]: <> (End) [marker]: <> (End:a71c12d9-5aa4-4b46-e2d6-08da0cf8cd95) Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
Adapt the source-file protection from #36572 to main so image processing writes to MAUI-owned cache files and only cleans up MAUI-owned temporary inputs after successful output. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9636383d-40ad-499b-ba17-8fe2c3a95d6a
abcbcc7 to
a8ea989
Compare
Skill Validation Results
❌ Skill Validation Results —
|
There was a problem hiding this comment.
🔵 Needs a closer look
Review details
Suppressed comments (1)
src/Essentials/src/MediaPicker/MediaPicker.android.cs:91
- If writing to the new cache file fails (e.g., CopyToAsync throws), the method catches the exception and returns the original path but can leave a partially-written cache file behind. That orphaned file can accumulate in app cache over time. Consider deleting the outputPath on write failure before rethrowing so the outer catch returns cleanly without leaking temp files.
using (var outputStream = File.Create(outputPath))
{
currentStream.Position = 0;
await currentStream.CopyToAsync(outputStream);
}
- Files reviewed: 3/3 changed files
- Comments generated: 0 new
- Review effort level: Lite
Remove partial cache outputs when image writes fail and limit regression-test cache searches to MAUI-owned temporary files. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9636383d-40ad-499b-ba17-8fe2c3a95d6a
There was a problem hiding this comment.
🔵 Needs a closer look
Review details
Suppressed comments (2)
Previously missed (1) — in code that hasn't changed since the last review.
src/Essentials/src/MediaPicker/MediaPicker.android.cs:47
- When both rotation and compression/resizing are requested, this branch rotates the image first via RotateImageAsync and then processes again via ProcessImageAsync. RotateImageAsync re-encodes the image and drops EXIF metadata, so the later PreserveMetaData path can no longer preserve metadata from the original. It also does two full decode/encode passes. Consider skipping the explicit rotation step when needsProcessing is true and let ProcessImageAsync handle rotation (rotateImage=true) on the original stream.
This issue also appears on line 63 of the same file.
if (needsRotation)
src/Essentials/src/MediaPicker/MediaPicker.android.cs:63
- ProcessImageAsync already supports performing EXIF rotation (and preserving metadata) when rotateImage is true. If the explicit rotation step is skipped when needsProcessing is true, this argument should be needsRotation instead of false; otherwise rotation won’t be applied in the combined rotation+processing scenario.
false,
- Files reviewed: 3/3 changed files
- Comments generated: 0 new
- Review effort level: Lite
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Summary Adapts the Android MediaPicker source-file protection from #36572 to `main`. Picked external source images are now treated as read-only. Rotation and compression are composed through streams, and the final result is written once to a MAUI-owned cache file. MAUI-owned temporary inputs are deleted only after the output is successfully written. Partial cache outputs are removed if writing fails. The existing main-branch result filename behavior is preserved. ## Provenance - Original PR: #36572 - Original merge commit: 45024c6 - Original commits: - 937544b - aed7544 - 9b0d5d4 - Main-targeted adaptation: a8ea989 - Review follow-up: f5fc79a ## Tests Added Android device regressions covering rotation-only, compression-only, combined processing, no-op behavior, external source byte preservation, a single terminal cache output, and MAUI-owned temporary-input cleanup. Validated on an Android API 25 emulator: **282 passed, 0 failed** in the Essentials device-test suite; all five MediaPicker regressions passed. ---------
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Summary Adapts the Android MediaPicker source-file protection from #36572 to `main`. Picked external source images are now treated as read-only. Rotation and compression are composed through streams, and the final result is written once to a MAUI-owned cache file. MAUI-owned temporary inputs are deleted only after the output is successfully written. Partial cache outputs are removed if writing fails. The existing main-branch result filename behavior is preserved. ## Provenance - Original PR: #36572 - Original merge commit: 45024c6 - Original commits: - 937544b - aed7544 - 9b0d5d4 - Main-targeted adaptation: a8ea989 - Review follow-up: f5fc79a ## Tests Added Android device regressions covering rotation-only, compression-only, combined processing, no-op behavior, external source byte preservation, a single terminal cache output, and MAUI-owned temporary-input cleanup. Validated on an Android API 25 emulator: **282 passed, 0 failed** in the Essentials device-test suite; all five MediaPicker regressions passed. ---------
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Summary Adapts the Android MediaPicker source-file protection from #36572 to `main`. Picked external source images are now treated as read-only. Rotation and compression are composed through streams, and the final result is written once to a MAUI-owned cache file. MAUI-owned temporary inputs are deleted only after the output is successfully written. Partial cache outputs are removed if writing fails. The existing main-branch result filename behavior is preserved. ## Provenance - Original PR: #36572 - Original merge commit: 45024c6 - Original commits: - 937544b - aed7544 - 9b0d5d4 - Main-targeted adaptation: a8ea989 - Review follow-up: f5fc79a ## Tests Added Android device regressions covering rotation-only, compression-only, combined processing, no-op behavior, external source byte preservation, a single terminal cache output, and MAUI-owned temporary-input cleanup. Validated on an Android API 25 emulator: **282 passed, 0 failed** in the Essentials device-test suite; all five MediaPicker regressions passed. ---------
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Summary Adapts the Android MediaPicker source-file protection from #36572 to `main`. Picked external source images are now treated as read-only. Rotation and compression are composed through streams, and the final result is written once to a MAUI-owned cache file. MAUI-owned temporary inputs are deleted only after the output is successfully written. Partial cache outputs are removed if writing fails. The existing main-branch result filename behavior is preserved. ## Provenance - Original PR: #36572 - Original merge commit: 45024c6 - Original commits: - 937544b - aed7544 - 9b0d5d4 - Main-targeted adaptation: a8ea989 - Review follow-up: f5fc79a ## Tests Added Android device regressions covering rotation-only, compression-only, combined processing, no-op behavior, external source byte preservation, a single terminal cache output, and MAUI-owned temporary-input cleanup. Validated on an Android API 25 emulator: **282 passed, 0 failed** in the Essentials device-test suite; all five MediaPicker regressions passed. ---------
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Summary Adapts the Android MediaPicker source-file protection from #36572 to `main`. Picked external source images are now treated as read-only. Rotation and compression are composed through streams, and the final result is written once to a MAUI-owned cache file. MAUI-owned temporary inputs are deleted only after the output is successfully written. Partial cache outputs are removed if writing fails. The existing main-branch result filename behavior is preserved. ## Provenance - Original PR: #36572 - Original merge commit: 45024c6 - Original commits: - 937544b - aed7544 - 9b0d5d4 - Main-targeted adaptation: a8ea989 - Review follow-up: f5fc79a ## Tests Added Android device regressions covering rotation-only, compression-only, combined processing, no-op behavior, external source byte preservation, a single terminal cache output, and MAUI-owned temporary-input cleanup. Validated on an Android API 25 emulator: **282 passed, 0 failed** in the Essentials device-test suite; all five MediaPicker regressions passed. ---------
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Summary Adapts the Android MediaPicker source-file protection from #36572 to `main`. Picked external source images are now treated as read-only. Rotation and compression are composed through streams, and the final result is written once to a MAUI-owned cache file. MAUI-owned temporary inputs are deleted only after the output is successfully written. Partial cache outputs are removed if writing fails. The existing main-branch result filename behavior is preserved. ## Provenance - Original PR: #36572 - Original merge commit: 45024c6 - Original commits: - 937544b - aed7544 - 9b0d5d4 - Main-targeted adaptation: a8ea989 - Review follow-up: f5fc79a ## Tests Added Android device regressions covering rotation-only, compression-only, combined processing, no-op behavior, external source byte preservation, a single terminal cache output, and MAUI-owned temporary-input cleanup. Validated on an Android API 25 emulator: **282 passed, 0 failed** in the Essentials device-test suite; all five MediaPicker regressions passed. ---------
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Summary Adapts the Android MediaPicker source-file protection from #36572 to `main`. Picked external source images are now treated as read-only. Rotation and compression are composed through streams, and the final result is written once to a MAUI-owned cache file. MAUI-owned temporary inputs are deleted only after the output is successfully written. Partial cache outputs are removed if writing fails. The existing main-branch result filename behavior is preserved. ## Provenance - Original PR: #36572 - Original merge commit: 45024c6 - Original commits: - 937544b - aed7544 - 9b0d5d4 - Main-targeted adaptation: a8ea989 - Review follow-up: f5fc79a ## Tests Added Android device regressions covering rotation-only, compression-only, combined processing, no-op behavior, external source byte preservation, a single terminal cache output, and MAUI-owned temporary-input cleanup. Validated on an Android API 25 emulator: **282 passed, 0 failed** in the Essentials device-test suite; all five MediaPicker regressions passed. ---------
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Summary Adapts the Android MediaPicker source-file protection from #36572 to `main`. Picked external source images are now treated as read-only. Rotation and compression are composed through streams, and the final result is written once to a MAUI-owned cache file. MAUI-owned temporary inputs are deleted only after the output is successfully written. Partial cache outputs are removed if writing fails. The existing main-branch result filename behavior is preserved. ## Provenance - Original PR: #36572 - Original merge commit: 45024c6 - Original commits: - 937544b - aed7544 - 9b0d5d4 - Main-targeted adaptation: a8ea989 - Review follow-up: f5fc79a ## Tests Added Android device regressions covering rotation-only, compression-only, combined processing, no-op behavior, external source byte preservation, a single terminal cache output, and MAUI-owned temporary-input cleanup. Validated on an Android API 25 emulator: **282 passed, 0 failed** in the Essentials device-test suite; all five MediaPicker regressions passed. ---------
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Summary Adapts the Android MediaPicker source-file protection from #36572 to `main`. Picked external source images are now treated as read-only. Rotation and compression are composed through streams, and the final result is written once to a MAUI-owned cache file. MAUI-owned temporary inputs are deleted only after the output is successfully written. Partial cache outputs are removed if writing fails. The existing main-branch result filename behavior is preserved. ## Provenance - Original PR: #36572 - Original merge commit: 45024c6 - Original commits: - 937544b - aed7544 - 9b0d5d4 - Main-targeted adaptation: a8ea989 - Review follow-up: f5fc79a ## Tests Added Android device regressions covering rotation-only, compression-only, combined processing, no-op behavior, external source byte preservation, a single terminal cache output, and MAUI-owned temporary-input cleanup. Validated on an Android API 25 emulator: **282 passed, 0 failed** in the Essentials device-test suite; all five MediaPicker regressions passed. ---------
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Summary Adapts the Android MediaPicker source-file protection from #36572 to `main`. Picked external source images are now treated as read-only. Rotation and compression are composed through streams, and the final result is written once to a MAUI-owned cache file. MAUI-owned temporary inputs are deleted only after the output is successfully written. Partial cache outputs are removed if writing fails. The existing main-branch result filename behavior is preserved. ## Provenance - Original PR: #36572 - Original merge commit: 45024c6 - Original commits: - 937544b - aed7544 - 9b0d5d4 - Main-targeted adaptation: a8ea989 - Review follow-up: f5fc79a ## Tests Added Android device regressions covering rotation-only, compression-only, combined processing, no-op behavior, external source byte preservation, a single terminal cache output, and MAUI-owned temporary-input cleanup. Validated on an Android API 25 emulator: **282 passed, 0 failed** in the Essentials device-test suite; all five MediaPicker regressions passed. ---------
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Summary Adapts the Android MediaPicker source-file protection from #36572 to `main`. Picked external source images are now treated as read-only. Rotation and compression are composed through streams, and the final result is written once to a MAUI-owned cache file. MAUI-owned temporary inputs are deleted only after the output is successfully written. Partial cache outputs are removed if writing fails. The existing main-branch result filename behavior is preserved. ## Provenance - Original PR: #36572 - Original merge commit: 45024c6 - Original commits: - 937544b - aed7544 - 9b0d5d4 - Main-targeted adaptation: a8ea989 - Review follow-up: f5fc79a ## Tests Added Android device regressions covering rotation-only, compression-only, combined processing, no-op behavior, external source byte preservation, a single terminal cache output, and MAUI-owned temporary-input cleanup. Validated on an Android API 25 emulator: **282 passed, 0 failed** in the Essentials device-test suite; all five MediaPicker regressions passed. ---------
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Summary
Adapts the Android MediaPicker source-file protection from #36572 to
main.Picked external source images are now treated as read-only. Rotation and compression are composed through streams, and the final result is written once to a MAUI-owned cache file. MAUI-owned temporary inputs are deleted only after the output is successfully written. Partial cache outputs are removed if writing fails. The existing main-branch result filename behavior is preserved.
Provenance
Tests
Added Android device regressions covering rotation-only, compression-only, combined processing, no-op behavior, external source byte preservation, a single terminal cache output, and MAUI-owned temporary-input cleanup.
Validated on an Android API 25 emulator: 282 passed, 0 failed in the Essentials device-test suite; all five MediaPicker regressions passed.