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

Commit d3a95351 authored by Wale Ogunwale's avatar Wale Ogunwale Committed by gitbuildkicker
Browse files

Fixed logic error with setting maxAspectRatio

Ignore maxAspectRatio values less than 1.0 and set it to 0 which
means use device aspect ratio.

Change-Id: Ib2c76f6232e3f7521a1a4565d7c0c9e1de9c9eac
Fixes: 36606641
Test: cts/.../run-test CtsAppTestCases android.app.cts.AspectRatioTests
(cherry picked from commit 0cb70ac4)
parent fc8f87b2
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -4400,8 +4400,12 @@ public class PackageParser {
            defaultMaxAspectRatio = owner.applicationInfo.maxAspectRatio;
        }

        aInfo.maxAspectRatio = Math.max(1.0f, sa.getFloat(
                R.styleable.AndroidManifestActivity_maxAspectRatio, defaultMaxAspectRatio));
        aInfo.maxAspectRatio = sa.getFloat(
                R.styleable.AndroidManifestActivity_maxAspectRatio, defaultMaxAspectRatio);
        if (aInfo.maxAspectRatio < 1.0f && aInfo.maxAspectRatio != 0) {
            // Ignore any value lesser than 1.0.
            aInfo.maxAspectRatio = 0;
        }
    }

    /**