From 3b8d8bc7813a803fb2183c96ec404a541b6ba9b0 Mon Sep 17 00:00:00 2001 From: Manish Singh Date: Wed, 2 Dec 2020 06:27:29 +0000 Subject: [PATCH] Introduce new preference indicating user control. If the user enables this, then that means that we will respect user's choices for all the preferences, i.e. we will not update the preferences based on the updates from server. On the other hand, if it's disabled, then the rest of the preferences would not be considered. And we'd decide their values based on the values from the DeviceConfig (which in turn come from the server). Also, renaming the set prop key for enabling-transcode to match the one in DeviceConfig - transcode_enabled. Also, the "transcode_enable_all" controller now enables (instead of disabling) the global level transcoding. BUG:169327180 Test: manual testing. Change-Id: I183b3b5496b647943be377c02c8c9e2a0df71752 --- core/java/android/os/FileUtils.java | 3 ++- packages/SettingsLib/res/values/strings.xml | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/core/java/android/os/FileUtils.java b/core/java/android/os/FileUtils.java index 5db4107f02f1b..379d6e6f5dfe3 100644 --- a/core/java/android/os/FileUtils.java +++ b/core/java/android/os/FileUtils.java @@ -1436,7 +1436,8 @@ public final class FileUtils { public static FileDescriptor convertToModernFd(FileDescriptor fd) { try { Context context = AppGlobals.getInitialApplication(); - if (!SystemProperties.getBoolean("persist.sys.fuse.transcode", false) + // TODO(b/169327180): Consider device config. + if (!SystemProperties.getBoolean("persist.sys.fuse.transcode_enabled", 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. diff --git a/packages/SettingsLib/res/values/strings.xml b/packages/SettingsLib/res/values/strings.xml index 810a5ac746f92..22213cba217df 100644 --- a/packages/SettingsLib/res/values/strings.xml +++ b/packages/SettingsLib/res/values/strings.xml @@ -995,8 +995,14 @@ Media transcoding settings - - Disable transcoding + + Override transcoding defaults + + + Enable transcoding + + + Assume apps support modern formats Enable transcoding for apps