Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 00ab464c authored by Zim's avatar Zim
Browse files

Revert "Set transcode DeviceConfigs"

This reverts commit a99ab83e.

Server side flag will be added, and in the meantime, these strings
will be added as a resource in MediaProvider

Bug: 174161238
Test: atest TranscodeTest
Change-Id: I2d3d9abc1ee5dc230e15f76aed2cc97064013ed5
parent 1216f9e9
Loading
Loading
Loading
Loading
+0 −34
Original line number Diff line number Diff line
@@ -108,7 +108,6 @@ import android.os.storage.StorageManagerInternal;
import android.os.storage.StorageVolume;
import android.os.storage.VolumeInfo;
import android.os.storage.VolumeRecord;
import android.provider.DeviceConfig;
import android.provider.DocumentsContract;
import android.provider.Downloads;
import android.provider.MediaStore;
@@ -206,27 +205,6 @@ class StorageManagerService extends IStorageManager.Stub
    private static final String ANDROID_VOLD_APP_DATA_ISOLATION_ENABLED_PROPERTY =
            "persist.sys.vold_app_data_isolation_enabled";

    // TODO(b/169327180): Will be fetched from the server, but for now, we emulate this in
    // the system_server since it can write to DeviceConfig and MediaProvider can read it
    private static final String PROP_TRANSCODE_ENABLED = "transcode_enabled";
    private static final String PROP_TRANSCODE_DEFAULT = "transcode_default";
    private static final String PROP_TRANSCODE_COMPAT_MANIFEST = "transcode_compat_manifest";
    private static final boolean TRANSCODE_ENABLED_VALUE = false;
    // Determines the default behavior of apps when transcode is enabled, AKA, Option A/Option B.
    // If true, transcode by default (Option B). If false, don't transcode by default (Option A)
    // For dogfood, we go with Option B
    private static final boolean TRANSCODE_DEFAULT_VALUE = true;
    // Format is <package_name>,<media_capability_bit_mask>,...
    // media_capability_bit_mask is defined in MediaProvider/../TranscodeHelper.java:
    // FLAG_HEVC = 1 << 0;
    // FLAG_SLOW_MOTION = 1 << 1;
    // FLAG_HDR_10 = 1 << 2;
    // FLAG_HDR_10_PLUS = 1 << 3;
    // FLAG_HDR_HLG = 1 << 4;
    // FLAG_HDR_DOLBY_VISION = 1 << 5;
    private static final String TRANSCODE_COMPAT_MANIFEST_VALUE =
            "com.google.android.apps.photos,1";

    // How long we wait to reset storage, if we failed to call onMount on the
    // external storage service.
    public static final int FAILED_MOUNT_RESET_TIMEOUT_SECONDS = 10;
@@ -901,18 +879,6 @@ class StorageManagerService extends IStorageManager.Stub
                    com.android.internal.R.bool.config_zramWriteback)) {
            ZramWriteback.scheduleZramWriteback(mContext);
        }

        // TODO(b/169327180): Remove after setting up server-side DeviceConfig flags
        // Set DeviceConfig values for transcoding that will be read by MediaProvider
        DeviceConfig.setProperty(DeviceConfig.NAMESPACE_STORAGE_NATIVE_BOOT,
                PROP_TRANSCODE_ENABLED, String.valueOf(TRANSCODE_ENABLED_VALUE),
                false /* makeDefault */);
        DeviceConfig.setProperty(DeviceConfig.NAMESPACE_STORAGE_NATIVE_BOOT,
                PROP_TRANSCODE_DEFAULT, String.valueOf(TRANSCODE_DEFAULT_VALUE),
                false /* makeDefault */);
        DeviceConfig.setProperty(DeviceConfig.NAMESPACE_STORAGE_NATIVE_BOOT,
                PROP_TRANSCODE_COMPAT_MANIFEST, TRANSCODE_COMPAT_MANIFEST_VALUE,
                false /* makeDefault */);
    }

    /**