Populate search attributes only if the atom's has DeviceSearchResultContainer.
Bug: 199495917, 218973952
Test: https://android-build.googleplex.com/builds/abtd/run/L37100000953023420
Change-Id: I355b4ec0806755f6c72d59b04555b970ca1578f5
diff --git a/quickstep/src/com/android/quickstep/logging/StatsLogCompatManager.java b/quickstep/src/com/android/quickstep/logging/StatsLogCompatManager.java
index a548408..12a638a 100644
--- a/quickstep/src/com/android/quickstep/logging/StatsLogCompatManager.java
+++ b/quickstep/src/com/android/quickstep/logging/StatsLogCompatManager.java
@@ -571,13 +571,16 @@
}
private static int getSearchAttributes(LauncherAtom.ItemInfo info) {
- /* TODO(b/218973952):Uncomment the logic after broken test is fixed.
- if (info.getContainerInfo().getExtendedContainers().getDeviceSearchResultContainer()
- .hasSearchAttributes()) {
- return searchAttributesToInt(info.getContainerInfo().getExtendedContainers()
- .getDeviceSearchResultContainer().getSearchAttributes());
- }
- */
+ ContainerInfo containerInfo = info.getContainerInfo();
+ if (containerInfo.getContainerCase() == EXTENDED_CONTAINERS
+ && containerInfo.getExtendedContainers().getContainerCase()
+ == DEVICE_SEARCH_RESULT_CONTAINER
+ && containerInfo.getExtendedContainers()
+ .getDeviceSearchResultContainer().hasSearchAttributes()
+ ) {
+ return searchAttributesToInt(containerInfo.getExtendedContainers()
+ .getDeviceSearchResultContainer().getSearchAttributes());
+ }
return 0;
}