Log device profile changes in perfetto traces

This is needed to easily spot unwanted DeviceProfile changes in perfetto traces, as each one causes many new inflation and slows down the ui thread considerably.

Test: recorded trace with this log
Bug: 258214245
Change-Id: I805d56d4dfe1c08d7f28215c0462d01fcaece84e
This commit is contained in:
Nicolo' Mazzucato committed 2023-01-17 14:54:11 +00:00
1 parent 77a388c79e
commit cb7bd50247
4 files changed
+37

No files matched your search

@@ -1679,6 +1679,16 @@ public class DeviceProfile {
writer.println(prefix + pxToDpStr("getCellLayoutWidth()", getCellLayoutWidth()));
}
/** Returns a reduced representation of this DeviceProfile. */
public String toSmallString() {
return "isTablet:" + isTablet + ", "
+ "isMultiDisplay:" + isMultiDisplay + ", "
+ "widthPx:" + widthPx + ", "
+ "heightPx:" + heightPx + ", "
+ "insets:" + mInsets + ", "
+ "rotationHint:" + rotationHint;
}
private static Context getContext(Context c, Info info, int orientation, WindowBounds bounds) {
Configuration config = new Configuration(c.getResources().getConfiguration());
config.orientation = orientation;