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

Commit ec05bc0f authored by Adam Lesinski's avatar Adam Lesinski
Browse files

Fix issue with fontScale changes not taking effect

If a configuration change occurs, and an underlying ResourcesImpl is
swapped out under a Resources object, the DisplayMetrics cached by
TypedArray will be stale and not up-to-date.

Bug: 34120637
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerConfigChangeTests
Change-Id: Id78a6d259250950387c2e95c4a2292fdd095c7af
parent 1e28c8fa
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -56,12 +56,13 @@ public class TypedArray {
        // Reset the assets, which may have changed due to configuration changes
        // or further resource loading.
        attrs.mAssets = res.getAssets();
        attrs.mMetrics = res.getDisplayMetrics();
        attrs.resize(len);
        return attrs;
    }

    private final Resources mResources;
    private final DisplayMetrics mMetrics;
    private DisplayMetrics mMetrics;
    private AssetManager mAssets;

    private boolean mRecycled;