From 1e5b621a50ee5ba23dbd9cb4fe93b572dc68806a Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Wed, 10 Nov 2021 20:32:55 -0800 Subject: [PATCH] Address AppEventProducer to correctly send search-result location on AppTargetEvent Bug: 191362091 Test: logcat printout 11-10 20:27:02.290 32215 32237 D QuickstepModelDelegate: notifyAppTargetEvent action=1launchLocation=search-results Change-Id: I16ef7679116e397a8a108cc291f5741febf2e453 --- .../android/launcher3/model/AppEventProducer.java | 13 ++++++++++--- .../launcher3/model/QuickstepModelDelegate.java | 2 ++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/launcher3/model/AppEventProducer.java b/quickstep/src/com/android/launcher3/model/AppEventProducer.java index 1305bbc7b2..7c29c5b4c6 100644 --- a/quickstep/src/com/android/launcher3/model/AppEventProducer.java +++ b/quickstep/src/com/android/launcher3/model/AppEventProducer.java @@ -271,9 +271,6 @@ public class AppEventProducer implements StatsLogConsumer { case ALL_APPS_CONTAINER: { return "all-apps"; } - case SEARCH_RESULT_CONTAINER: { - return "search-results"; - } case PREDICTED_HOTSEAT_CONTAINER: { return "predictions/hotseat"; } @@ -293,6 +290,16 @@ public class AppEventProducer implements StatsLogConsumer { } return "folder"; } + case SEARCH_RESULT_CONTAINER: + return "search-results"; + case EXTENDED_CONTAINERS: { + switch(ci.getExtendedContainers().getContainerCase()) { + case DEVICE_SEARCH_RESULT_CONTAINER: + case CORRECTED_DEVICE_SEARCH_RESULT_CONTAINER: + return "search-results"; + } + } + default: // fall out } return ""; } diff --git a/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java b/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java index 7794d27d26..e82c900734 100644 --- a/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java +++ b/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java @@ -329,6 +329,8 @@ public class QuickstepModelDelegate extends ModelDelegate { } if (state.predictor != null) { state.predictor.notifyAppTargetEvent(event); + Log.d(TAG, "notifyAppTargetEvent action=" + event.getAction() + + " launchLocation=" + event.getLaunchLocation()); } }