summaryrefslogtreecommitdiff
path: root/java/src-debug
diff options
context:
space:
mode:
author Andrey Epin <ayepin@google.com> 2023-08-15 00:53:21 -0700
committer Andrey Epin <ayepin@google.com> 2023-08-18 15:07:35 -0700
commit8ac875364c8d77b6f4a0ff2a10f9b4b5976618f6 (patch)
tree2960a8a3efe1ec2e7d11956a53173664827ed0b8 /java/src-debug
parentea59592a728c2fb00070f15873e85939b806a3d9 (diff)
Fix PreviewDataProvider previewType and firstFileInfo timeout logic
Execute time-critical operations within `withTimeoutOrNull` function on a different task launched from a separate scope. The separate scope is need as, according to structural concurrency principals, `withTimeout`, upon timeout, canceling all its child jobs and completes only when all of them complete. The core of the logic we're wrapping with the timeout are ContentProvider calls which are not cancellable (and the whole operation can be canceled in some intermediate points between the calls). Calling them from another scope allows us just abandon them on timeout which is OK as we run the logic once anyway (and cache the results). Bug: 295985906 Test: Use the ShareTest app with metadata timeout and media type disguise option. Test: Integration tests. Change-Id: I922142385804abd78c2ad880d88d416d78155800
Diffstat (limited to 'java/src-debug')
0 files changed, 0 insertions, 0 deletions