summaryrefslogtreecommitdiffstats
path: root/go
diff options
context:
space:
mode:
authorKevin <kevhan@google.com>2019-05-09 10:52:16 -0700
committerKevin <kevhan@google.com>2019-05-09 14:12:40 -0700
commit90137b035c8e9f0537dec2f056d0a1423c50241b (patch)
treeba8d3b1ace672e41b217daeeea09c24ea56709a4 /go
parent75d2bcbe41bb3a671bfba2cacb72455247053f17 (diff)
downloadandroid_packages_apps_Trebuchet-90137b035c8e9f0537dec2f056d0a1423c50241b.tar.gz
android_packages_apps_Trebuchet-90137b035c8e9f0537dec2f056d0a1423c50241b.tar.bz2
android_packages_apps_Trebuchet-90137b035c8e9f0537dec2f056d0a1423c50241b.zip
Add task launch logging to Recents Go
Add logging points for launching tasks in Recents Go to match up with non-Go Recents. Bug: 131840601 Test: Log calls to confirm writing to stats log on task launch Change-Id: I3d7b1ed30f99ce9f551c3481628ca81540e366b5
Diffstat (limited to 'go')
-rw-r--r--go/quickstep/src/com/android/quickstep/TaskActionController.java17
-rw-r--r--go/quickstep/src/com/android/quickstep/views/IconRecentsView.java3
2 files changed, 15 insertions, 5 deletions
diff --git a/go/quickstep/src/com/android/quickstep/TaskActionController.java b/go/quickstep/src/com/android/quickstep/TaskActionController.java
index 0e921c0db..f49fa3ef4 100644
--- a/go/quickstep/src/com/android/quickstep/TaskActionController.java
+++ b/go/quickstep/src/com/android/quickstep/TaskActionController.java
@@ -16,14 +16,17 @@
package com.android.quickstep;
import static com.android.quickstep.TaskAdapter.TASKS_START_POSITION;
+import static com.android.quickstep.TaskUtils.getLaunchComponentKeyForTask;
import android.app.ActivityOptions;
import android.view.View;
import androidx.annotation.NonNull;
+import com.android.launcher3.logging.StatsLogManager;
import com.android.quickstep.views.TaskItemView;
import com.android.systemui.shared.recents.model.Task;
+import com.android.systemui.shared.recents.model.Task.TaskKey;
import com.android.systemui.shared.system.ActivityManagerWrapper;
/**
@@ -34,10 +37,13 @@ public final class TaskActionController {
private final TaskListLoader mLoader;
private final TaskAdapter mAdapter;
+ private final StatsLogManager mStatsLogManager;
- public TaskActionController(TaskListLoader loader, TaskAdapter adapter) {
+ public TaskActionController(TaskListLoader loader, TaskAdapter adapter,
+ StatsLogManager logManager) {
mLoader = loader;
mAdapter = adapter;
+ mStatsLogManager = logManager;
}
/**
@@ -56,10 +62,11 @@ public final class TaskActionController {
int width = v.getMeasuredWidth();
int height = v.getMeasuredHeight();
+ TaskKey key = viewHolder.getTask().get().key;
ActivityOptions opts = ActivityOptions.makeClipRevealAnimation(v, left, top, width, height);
- ActivityManagerWrapper.getInstance().startActivityFromRecentsAsync(
- viewHolder.getTask().get().key, opts, null /* resultCallback */,
- null /* resultCallbackHandler */);
+ ActivityManagerWrapper.getInstance().startActivityFromRecentsAsync(key, opts,
+ null /* resultCallback */, null /* resultCallbackHandler */);
+ mStatsLogManager.logTaskLaunch(null /* view */, getLaunchComponentKeyForTask(key));
}
/**
@@ -71,6 +78,7 @@ public final class TaskActionController {
ActivityOptions opts = ActivityOptions.makeBasic();
ActivityManagerWrapper.getInstance().startActivityFromRecentsAsync(task.key, opts,
null /* resultCallback */, null /* resultCallbackHandler */);
+ mStatsLogManager.logTaskLaunch(null /* view */, getLaunchComponentKeyForTask(task.key));
}
/**
@@ -87,6 +95,7 @@ public final class TaskActionController {
ActivityManagerWrapper.getInstance().removeTask(task.key.id);
mLoader.removeTask(task);
mAdapter.notifyItemRemoved(position);
+ // TODO(b/131840601): Add logging point for removal.
}
/**
diff --git a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
index 07faa4bbd..79e0bbed1 100644
--- a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
+++ b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
@@ -154,7 +154,8 @@ public final class IconRecentsView extends FrameLayout implements Insettable {
mTaskLoader = new TaskListLoader(mContext);
mTaskAdapter = new TaskAdapter(mTaskLoader);
mTaskAdapter.setOnClearAllClickListener(view -> animateClearAllTasks());
- mTaskActionController = new TaskActionController(mTaskLoader, mTaskAdapter);
+ mTaskActionController = new TaskActionController(mTaskLoader, mTaskAdapter,
+ mActivity.getStatsLogManager());
mTaskAdapter.setActionController(mTaskActionController);
mTaskLayoutManager = new LinearLayoutManager(mContext, VERTICAL, true /* reverseLayout */);
RecentsModel.INSTANCE.get(context).addThumbnailChangeListener(listener);