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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23634884

Change-Id: I2c79a63f508784a64ec9ce1374c8bce4316e9dd0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2023-06-26 15:27:16 +00:00
committed by Automerger Merge Worker

View File

@@ -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;
}
}