Removed vsync offset check from display info equality
We recently added a mechanism for emitting refresh rate events when framerate is overridden. However, when framerate overridding happens, appVsyncOffsetNanos is also changed which is used to validate the displayInfo equality. This led to emission of both display changed and refresh rate changed events. https://android-build.corp.google.com/abtd/run/L57400030009232963/ was used to validate the metrics fix with the suggested changes
Bug: 387962667
Test: Manual testing
Flag: EXEMPT trivial change
Change-Id: I114a9958831f12cbf2492e6ebf3fc7302b7ae1e5
diff --git a/core/java/android/view/DisplayInfo.java b/core/java/android/view/DisplayInfo.java
index e75b1b0..ecdbaa3 100644
--- a/core/java/android/view/DisplayInfo.java
+++ b/core/java/android/view/DisplayInfo.java
@@ -493,8 +493,6 @@
&& logicalDensityDpi == other.logicalDensityDpi
&& physicalXDpi == other.physicalXDpi
&& physicalYDpi == other.physicalYDpi
- && appVsyncOffsetNanos == other.appVsyncOffsetNanos
- && presentationDeadlineNanos == other.presentationDeadlineNanos
&& state == other.state
&& committedState == other.committedState
&& ownerUid == other.ownerUid
@@ -517,6 +515,8 @@
if (compareRefreshRate) {
return isEqualWithoutRefreshRate
&& (getRefreshRate() == other.getRefreshRate())
+ && appVsyncOffsetNanos == other.appVsyncOffsetNanos
+ && presentationDeadlineNanos == other.presentationDeadlineNanos
&& (modeId == other.modeId);
}
return isEqualWithoutRefreshRate;