diff options
| author | Zim <zezeozue@google.com> | 2020-11-12 14:08:11 +0000 |
|---|---|---|
| committer | Zim <zezeozue@google.com> | 2020-11-12 14:15:02 +0000 |
| commit | d2f9505d19a1fd51932cdcdb9be3ffc8b4d680b9 (patch) | |
| tree | 0f08d5a3fb3177343f84480d66c6fb7f46dc8edc /core/java/android/os/FileUtils.java | |
| parent | 9b8c7fcaa9a494fc219693499447cd7865307ea4 (diff) | |
Revise seamless transcoding optimization flags
These flags determine if we bypass transcoding in several platform
media classes.
We previously, had non-perssitent, default-false flags for each
framework class.
Now, we have one persistent default-true 'optimize' flag:
persist.sys.fuse.transcode_optimize.
Of course, if the global transcode flag, persist.sys.fuse.transcode is
off, the code is a no-op.
Bug: 158465539
Test: Manual
Change-Id: Ie1442213d0744888bac45b43ad8a07f0ebf55066
Diffstat (limited to 'core/java/android/os/FileUtils.java')
| -rw-r--r-- | core/java/android/os/FileUtils.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/java/android/os/FileUtils.java b/core/java/android/os/FileUtils.java index d151c16061d9..5db4107f02f1 100644 --- a/core/java/android/os/FileUtils.java +++ b/core/java/android/os/FileUtils.java @@ -1436,7 +1436,10 @@ public final class FileUtils { public static FileDescriptor convertToModernFd(FileDescriptor fd) { try { Context context = AppGlobals.getInitialApplication(); - if (UserHandle.getAppId(Process.myUid()) == getMediaProviderAppId(context)) { + if (!SystemProperties.getBoolean("persist.sys.fuse.transcode", false) + || !SystemProperties.getBoolean("persist.sys.fuse.transcode_optimize", true) + || UserHandle.getAppId(Process.myUid()) == getMediaProviderAppId(context)) { + // If transcode is enabled we optimize by default, unless explicitly disabled. // Never convert modern fd for MediaProvider, because this requires // MediaStore#scanFile and can cause infinite loops when MediaProvider scans return null; |
