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

Commit 39f6dcef authored by Songyue Han's avatar Songyue Han Committed by Automerger Merge Worker
Browse files

Merge "Java MediaCodecInfo: Fix lazy initialization of getSizeRange." into...

Merge "Java MediaCodecInfo: Fix lazy initialization of getSizeRange." into main am: a6de6d01 am: 30d51da9

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3542312



Change-Id: If7eb65a2db1a162fdb0d8fd0a4835164f6b70751
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 03ec63dd 30d51da9
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -219,13 +219,14 @@ public final class MediaCodecInfo {
    private static final int DEFAULT_MAX_SUPPORTED_INSTANCES = 32;
    private static final int MAX_SUPPORTED_INSTANCES_LIMIT = 256;

    private static final class LazyHolder {
        private static final Range<Integer> SIZE_RANGE = Process.is64Bit()
    private static Range<Integer> SIZE_RANGE;
    private static synchronized Range<Integer> getSizeRange() {
        if (SIZE_RANGE == null) {
            SIZE_RANGE = Process.is64Bit()
                    ? Range.create(1, 32768)
                    : Range.create(1, MediaProperties.resolution_limit_32bit().orElse(4096));
        }
    private static Range<Integer> getSizeRange() {
        return LazyHolder.SIZE_RANGE;
        return SIZE_RANGE;
    }

    // found stuff that is not supported by framework (=> this should not happen)