Optimize FileSystemProvider.includeFile
When traversing a file tree using SAF, this method is called for
every file in the tree, so wasted cycles add up to quite a lot
of total time for large trees.
Optimizations:
- don't look up info not necessary by the cursor, by inspecting
the projection columns
- remove a few redundant double-lookups, of e.g. the File path
- mark variables final where possible
On my device/file tree, this reduces the total time spent in includeFile
from ~33 seconds to ~22 seconds. This is where the majority of cycles
are spent when traversing a dir with SAF.
Bug: 130276310
Test: SAF test app
Change-Id: Ibdfc335253a90eb87795a7a4eecb8b7b89601f09
2 files changed