Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7938e9fb authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Log source component instead of current task base intent" into ub-launcher3-edmonton

parents af19ffff 3cc3df59
Loading
Loading
Loading
Loading
+991 B (130 KiB)

File changed.

No diff preview for this file type.

+1 −1
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ public class QuickScrubController implements OnAlarmListener {
                    } else {
                        mActivity.getUserEventDispatcher().logTaskLaunchOrDismiss(Touch.DRAGDROP,
                                LauncherLogProto.Action.Direction.NONE, page,
                                TaskUtils.getComponentKeyForTask(taskView.getTask().key));
                                TaskUtils.getLaunchComponentKeyForTask(taskView.getTask().key));
                    }
                    mWaitingForTaskLaunch = false;
                }, taskView.getHandler());
+5 −2
Original line number Diff line number Diff line
@@ -75,8 +75,11 @@ public class TaskUtils {
            applicationInfo.loadLabel(packageManager), user);
    }

    public static ComponentKey getComponentKeyForTask(Task.TaskKey taskKey) {
        return new ComponentKey(taskKey.getComponent(), UserHandle.of(taskKey.userId));
    public static ComponentKey getLaunchComponentKeyForTask(Task.TaskKey taskKey) {
        final ComponentName cn = taskKey.sourceComponent != null
                ? taskKey.sourceComponent
                : taskKey.getComponent();
        return new ComponentKey(cn, UserHandle.of(taskKey.userId));
    }


+6 −5
Original line number Diff line number Diff line
@@ -667,9 +667,10 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl

            // The temporary running task is only used for the duration between the start of the
            // gesture and the task list is loaded and applied
            mTmpRunningTask = new Task(new Task.TaskKey(runningTaskId, 0, new Intent(), 0, 0), null,
                    null, "", "", 0, 0, false, true, false, false,
                    new ActivityManager.TaskDescription(), 0, new ComponentName("", ""), false);
            mTmpRunningTask = new Task(new Task.TaskKey(runningTaskId, 0, new Intent(),
                    new ComponentName(getContext(), getClass()), 0, 0), null, null, "", "", 0, 0,
                    false, true, false, false, new ActivityManager.TaskDescription(), 0,
                    new ComponentName("", ""), false);
            taskView.bind(mTmpRunningTask);
        }
        setCurrentTask(runningTaskId);
@@ -792,7 +793,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
            if (shouldLog) {
                mActivity.getUserEventDispatcher().logTaskLaunchOrDismiss(
                        onEndListener.logAction, Direction.UP, index,
                        TaskUtils.getComponentKeyForTask(task.key));
                        TaskUtils.getLaunchComponentKeyForTask(task.key));
            }
        }
    }
@@ -1229,7 +1230,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
                if (task != null) {
                    mActivity.getUserEventDispatcher().logTaskLaunchOrDismiss(
                            onEndListener.logAction, Direction.DOWN, indexOfChild(tv),
                            TaskUtils.getComponentKeyForTask(task.key));
                            TaskUtils.getLaunchComponentKeyForTask(task.key));
                }
            } else {
                onTaskLaunchFinish.accept(false);
+1 −1
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ public class TaskView extends FrameLayout implements TaskCallbacks, PageCallback
            launchTask(true /* animate */);
            BaseActivity.fromContext(context).getUserEventDispatcher().logTaskLaunchOrDismiss(
                    Touch.TAP, Direction.NONE, getRecentsView().indexOfChild(this),
                    TaskUtils.getComponentKeyForTask(getTask().key));
                    TaskUtils.getLaunchComponentKeyForTask(getTask().key));
        });
        setOutlineProvider(new TaskOutlineProvider(getResources()));
    }