[AA+] Log tap on SearchActionItem.

Bug: 178562918
Test: Presubmit
Change-Id: I42a44de4f3cc02ca331c4f99c107891c4658995d
This commit is contained in:
thiruram 2021-02-19 10:09:56 -08:00 committed by Thiru Ramasamy
parent 1739c5c68e
commit f8f2a6ed0a
4 changed files with 27 additions and 0 deletions

View File

@ -29,6 +29,7 @@ message ItemInfo {
Shortcut shortcut = 3;
Widget widget = 4;
FolderIcon folder_icon = 9;
SearchActionItem search_action_item = 11;
}
// When used for launch event, stores the global predictive rank
optional int32 rank = 5;
@ -169,6 +170,12 @@ message FolderIcon {
optional string label_info = 4;
}
// Represents SearchAction with in launcher
message SearchActionItem{
optional string package_name = 1;
optional string title = 2;
}
//////////////////////////////////////////////
// Containers

View File

@ -327,6 +327,8 @@ public class StatsLogCompatManager extends StatsLogManager {
return info.getWidget().getPackageName();
case TASK:
return info.getTask().getPackageName();
case SEARCH_ACTION_ITEM:
return info.getSearchActionItem().getPackageName();
default:
return null;
}
@ -342,6 +344,8 @@ public class StatsLogCompatManager extends StatsLogManager {
return info.getWidget().getComponentName();
case TASK:
return info.getTask().getComponentName();
case SEARCH_ACTION_ITEM:
return info.getSearchActionItem().getTitle();
default:
return null;
}

View File

@ -25,6 +25,9 @@ import android.os.UserHandle;
import androidx.annotation.Nullable;
import com.android.launcher3.logger.LauncherAtom.ItemInfo;
import com.android.launcher3.logger.LauncherAtom.SearchActionItem;
/**
* Represents a SearchAction with in launcher
*/
@ -112,4 +115,15 @@ public class SearchActionItemInfo extends ItemInfoWithIcon {
public ItemInfoWithIcon clone() {
return new SearchActionItemInfo(this);
}
@Override
public ItemInfo buildProto(FolderInfo fInfo) {
return getDefaultItemInfoBuilder()
.setSearchActionItem(
SearchActionItem.newBuilder()
.setTitle(title.toString())
.setPackageName(mFallbackPackageName))
.setContainerInfo(getContainerInfo())
.build();
}
}

View File

@ -17,6 +17,7 @@ package com.android.launcher3.touch;
import static com.android.launcher3.Launcher.REQUEST_BIND_PENDING_APPWIDGET;
import static com.android.launcher3.Launcher.REQUEST_RECONFIGURE_APPWIDGET;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_OPEN;
import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_DISABLED_BY_PUBLISHER;
import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_DISABLED_LOCKED_USER;
@ -272,6 +273,7 @@ public class ItemClickHandler {
Toast.LENGTH_SHORT).show();
}
}
launcher.getStatsLogManager().logger().withItemInfo(itemInfo).log(LAUNCHER_APP_LAUNCH_TAP);
}
private static void startAppShortcutOrInfoActivity(View v, ItemInfo item, Launcher launcher) {