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

Commit 72ac76b7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Avoid 60ms QS inflations on UI thread after density changes" into udc-qpr-dev

parents 81682339 f214666b
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -28,11 +28,11 @@ import android.content.res.Resources;
public class InterestingConfigChanges {
    private final Configuration mLastConfiguration = new Configuration();
    private final int mFlags;
    private int mLastDensity;

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

    public InterestingConfigChanges(int flags) {
@@ -50,11 +50,6 @@ public class InterestingConfigChanges {
    public boolean applyNewConfig(Resources res) {
        int configChanges = mLastConfiguration.updateFrom(
                Configuration.generateDelta(mLastConfiguration, res.getConfiguration()));
        boolean densityChanged = mLastDensity != res.getDisplayMetrics().densityDpi;
        if (densityChanged || (configChanges & (mFlags)) != 0) {
            mLastDensity = res.getDisplayMetrics().densityDpi;
            return true;
        }
        return false;
        return (configChanges & (mFlags)) != 0;
    }
}