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

Commit da49c8bf authored by Evan Rosky's avatar Evan Rosky
Browse files

Remove very repeated calls to onMergedOverrideConfigurationChanged

Somehow we got to the point where we are calling this repeatedly
for a single config change: onCfgChg calls onMerged which
internally calls onMerged for whole subtree. But then, onCfgChg
also walks the whole subtree, so we end up calling onMerged
many times.

Bug: 202201326
Test: this is functionally no-op, so existing tests.
Change-Id: I6a5b5936c8afc51022532880647f7342f5fd22d1
parent 7273f041
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -9269,13 +9269,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            Slog.w(TAG, errorMessage);
        }

        // Configuration's equality doesn't consider seq so if only seq number changes in resolved
        // override configuration. Therefore ConfigurationContainer doesn't change merged override
        // configuration, but it's used to push configuration changes so explicitly update that.
        if (getMergedOverrideConfiguration().seq != getResolvedOverrideConfiguration().seq) {
            onMergedOverrideConfigurationChanged();
        }

        // Before PiP animation is done, th windowing mode of the activity is still the previous
        // mode (see RootWindowContainer#moveActivityToPinnedRootTask). So once the windowing mode
        // of activity is changed, it is the signal of the last step to update the PiP states.
+3 −9
Original line number Diff line number Diff line
@@ -223,9 +223,9 @@ public abstract class ConfigurationContainer<E extends ConfigurationContainer> {
    }

    /**
     * Update merged override configuration based on corresponding parent's config and notify all
     * its children. If there is no parent, merged override configuration will set equal to current
     * override config.
     * Update merged override configuration based on corresponding parent's config. If there is no
     * parent, merged override configuration will set equal to current override config. This
     * doesn't cascade on its own since it's called by {@link #onConfigurationChanged}.
     * @see #mMergedOverrideConfiguration
     */
    void onMergedOverrideConfigurationChanged() {
@@ -240,10 +240,6 @@ public abstract class ConfigurationContainer<E extends ConfigurationContainer> {
        } else {
            mMergedOverrideConfiguration.setTo(mResolvedOverrideConfiguration);
        }
        for (int i = getChildCount() - 1; i >= 0; --i) {
            final ConfigurationContainer child = getChildAt(i);
            child.onMergedOverrideConfigurationChanged();
        }
    }

    /**
@@ -688,8 +684,6 @@ public abstract class ConfigurationContainer<E extends ConfigurationContainer> {
        if (newParent != null) {
            // Update full configuration of this container and all its children.
            onConfigurationChanged(newParent.mFullConfiguration);
            // Update merged override configuration of this container and all its children.
            onMergedOverrideConfigurationChanged();
        }
    }