summaryrefslogtreecommitdiff
path: root/core/java/android/os/FileUtils.java
diff options
context:
space:
mode:
authorZim <zezeozue@google.com>2020-12-14 11:51:54 +0000
committerZimuzo Ezeozue <zezeozue@google.com>2020-12-14 13:25:28 +0000
commit3952caa992edb7e67ea4753040476c1b5fd804cc (patch)
tree2f484485af3cd0158d646fa2dc760a01ada661f1 /core/java/android/os/FileUtils.java
parent76b105c20aecdb5005b4455248671dd2bc69167c (diff)
Fix transcode_optimize flags
The optimize flag depended on transcode_enabled (sysprop only, ignoring device_config) flag to take effect. Now, we removed the 'optimize' flag and rely on a new non-persistent sysprop that says if transcode was enabled on the current boot. This means that a reboot is required for 'optimizations' to take effect, right after enabling/disabling transcode. This is anyways a better trade-off than ignoring the device_config transcode_enabled flag entirely. Test: Manual Bug: 170488060 Change-Id: I77bbc30f9fae2cfc0085c32028859fdbbc9aaed7
Diffstat (limited to 'core/java/android/os/FileUtils.java')
-rw-r--r--core/java/android/os/FileUtils.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/core/java/android/os/FileUtils.java b/core/java/android/os/FileUtils.java
index 379d6e6f5dfe..92fe98ca1044 100644
--- a/core/java/android/os/FileUtils.java
+++ b/core/java/android/os/FileUtils.java
@@ -1436,9 +1436,7 @@ public final class FileUtils {
public static FileDescriptor convertToModernFd(FileDescriptor fd) {
try {
Context context = AppGlobals.getInitialApplication();
- // TODO(b/169327180): Consider device config.
- if (!SystemProperties.getBoolean("persist.sys.fuse.transcode_enabled", false)
- || !SystemProperties.getBoolean("persist.sys.fuse.transcode_optimize", true)
+ if (!SystemProperties.getBoolean("sys.fuse.transcode_enabled", false)
|| 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