← Back to Pull requests

Fix Android log-copy crashes and enhancement graph rebuilds #3491

Closed
unknown closed this pull request without merging on Sep 28, 2026 10:28 UTC
View on GitHub
unknown unknown commented on Sep 27, 2026 19:28 UTC
Author

Closes #3488

Copying a multi-megabyte Android log can terminate the app with TransactionTooLargeException. The attached issue log contains clipboard parcels over 16 MB; a 9.45 MB synthetic log also reproduced the crash on the Android 15 emulator.

  • Read at most 128 Ki UTF-16 characters plus one overflow character on Dispatchers.IO. Copy complete small logs; for oversized logs, leave the clipboard intact and direct the user to share the complete file.

  • Handle file/clipboard failures with localized feedback, while preserving coroutine cancellation.

  • Keep Android video enhancement effects independent of video metadata availability. The scaler receives actual frame dimensions through Media3's configure(), so unknown/recovered metadata does not remove and reinstall the scaler and recompile the quality shaders. Viewport and mode changes still update the effects.
  • Verification:

  • :app:shared:ui-settings:testAndroidHostTest — 28 tests passed, including six log-copy regression cases (Unicode, exact limit, overflow/8 MB input, missing file, clipboard rejection, cancellation).

  • :app:shared:video-player:testAndroidHostTest — 36 tests passed. The added controller test covers unknown/known video dimensions, a seek, metadata loss/recovery, viewport resize, and disabling enhancement. It fails with the original scaler condition.

  • :app:android:assembleDefaultDebug -Pani.android.abis=arm64-v8a — passed.

  • Used .agents/skills/android-ui-verify on Pixel 8 Pro API 35, 1344 × 2992 at 480 dpi, with the built APK. Reproduced the baseline clipboard crash (data parcel size 18900248 bytes). With the fix, the process remains alive for oversized and missing logs, small logs reach the system clipboard, and the 9.45 MB log opens in the file-sharing chooser.

  • Changes affect Android behavior only; desktop/iOS implementations are unchanged.
  • Playback verification limit: the graph invalidation regression is covered by the controller test, but the reported 1–2 second seek delay has not been reproduced or measured on the Honor X50 Pro / Snapdragon 8+ Gen 1. This PR does not establish that graph recompilation was the sole cause of that device's delay; real-device playback confirmation is still needed.

    Android runtime screenshots (synthetic logs only):

    | Oversized log: guidance, app stays alive | Small log: Android clipboard preview |
    | --- | --- |
    | <img src="https://raw.githubusercontent.com/open-ani/animeko/fc9a9863fd3d3045311f3013405795da1af47f5c/large-log.png" width="320" alt="Oversized log shows guidance to share the log file" /> | <img src="https://raw.githubusercontent.com/open-ani/animeko/fc9a9863fd3d3045311f3013405795da1af47f5c/small-log.png" width="320" alt="Small synthetic log appears in Android clipboard preview" /> |

    | Missing log: handled read failure | Complete large log: share chooser |
    | --- | --- |
    | <img src="https://raw.githubusercontent.com/open-ani/animeko/fc9a9863fd3d3045311f3013405795da1af47f5c/read-failed.png" width="320" alt="Missing log shows Copy failed without terminating the app" /> | <img src="https://raw.githubusercontent.com/open-ani/animeko/fc9a9863fd3d3045311f3013405795da1af47f5c/share-log.png" width="320" alt="Android share chooser offers app.log after oversized-log copy was rejected" /> |

    Diff: 409 lines (+306 / -103) across 5 files Reviewer: Him188 Review duration: 899m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 409 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.360
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3491"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 44.9% (MEDIUM) · Higher = larger blast radius
    44.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.7% · Safe to merge
    17.7%