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

Commit 4e90170d authored by Nicolo' Mazzucato's avatar Nicolo' Mazzucato
Browse files

Remove CONFIG_SCREEN_LAYOUT from InterestingConfigChanges params

This bit was causing a bunch of reinflations each time a foldable device was unfolded/folded.
From some manual testing, it seems everything still works as expected after the change.

Instead, CONFIG_LAYOUT_DIRECTION has been added, to cover the RTL change case.

This change saves ~295 ms when the device is unfolded.

Bug: 197515205
Test: Manually tested
Change-Id: I4a1943f56716100027c0aafb6746ba4e8aec02ae
parent 2fb73232
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -31,9 +31,8 @@ public class InterestingConfigChanges {
    private int mLastDensity;

    public InterestingConfigChanges() {
        this(ActivityInfo.CONFIG_LOCALE
                | ActivityInfo.CONFIG_UI_MODE | ActivityInfo.CONFIG_SCREEN_LAYOUT
                | ActivityInfo.CONFIG_ASSETS_PATHS);
        this(ActivityInfo.CONFIG_LOCALE | ActivityInfo.CONFIG_LAYOUT_DIRECTION
                | ActivityInfo.CONFIG_UI_MODE | ActivityInfo.CONFIG_ASSETS_PATHS);
    }

    public InterestingConfigChanges(int flags) {
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ public class FragmentHostManager {
    private final View mRootView;
    private final InterestingConfigChanges mConfigChanges = new InterestingConfigChanges(
            ActivityInfo.CONFIG_FONT_SCALE | ActivityInfo.CONFIG_LOCALE
                | ActivityInfo.CONFIG_SCREEN_LAYOUT | ActivityInfo.CONFIG_ASSETS_PATHS);
                    | ActivityInfo.CONFIG_LAYOUT_DIRECTION | ActivityInfo.CONFIG_ASSETS_PATHS);
    private final FragmentService mManager;
    private final ExtensionFragmentManager mPlugins = new ExtensionFragmentManager();