Add grid_x field to DeviceSearchResultContainer.

Bug: 233297670
Test: Manual. https://paste.googleplex.com/4745437455056896

Change-Id: I63a0b2ad52282dbf836e5a26c983d3253d2aec43
This commit is contained in:
Anushree Ganjam 2022-06-03 01:21:05 +00:00
parent 2d5bda75fc
commit 8763cb57d4
2 changed files with 15 additions and 4 deletions

View File

@ -22,6 +22,7 @@ option java_outer_classname = "LauncherAtomExtensions";
// Wrapper message for containers used at the quickstep level.
// Message name should match with launcher_atom_extension.proto message at
// the AOSP level.
// Next ID = 3
message ExtendedContainers {
reserved 2; // Deleted fields
@ -31,10 +32,16 @@ message ExtendedContainers {
}
// Represents on-device search result container.
// Next ID = 4
message DeviceSearchResultContainer{
optional int32 query_length = 1;
optional SearchAttributes search_attributes = 2;
// [0, m], m varies based on the display density and resolution
// To indicate the location of the tapped on-device search result.
// For application, it will be the column number in the apps row.
optional int32 grid_x = 3;
// Next ID = 4
message SearchAttributes{
// True if results are based on spell corrected query

View File

@ -574,14 +574,18 @@ public class StatsLogCompatManager extends StatsLogManager {
}
private static int getGridX(LauncherAtom.ItemInfo info, boolean parent) {
if (info.getContainerInfo().getContainerCase() == FOLDER) {
LauncherAtom.ContainerInfo containerInfo = info.getContainerInfo();
if (containerInfo.getContainerCase() == FOLDER) {
if (parent) {
return info.getContainerInfo().getFolder().getWorkspace().getGridX();
return containerInfo.getFolder().getWorkspace().getGridX();
} else {
return info.getContainerInfo().getFolder().getGridX();
return containerInfo.getFolder().getGridX();
}
} else if (containerInfo.getContainerCase() == EXTENDED_CONTAINERS) {
return containerInfo.getExtendedContainers()
.getDeviceSearchResultContainer().getGridX();
} else {
return info.getContainerInfo().getWorkspace().getGridX();
return containerInfo.getWorkspace().getGridX();
}
}