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

Commit 2a70b3d6 authored by Hyunyoung Song's avatar Hyunyoung Song
Browse files

Fix HOME/RECENTS/BACK duplicated, missing logging

Bug:132906035

Double logging onResume when Launcher resumed via back
Double BACK logging when in taskswitcher state

Change-Id: I44233339b238b6bee32ec2c7b0de4908b2556566
parent 1a66df25
Loading
Loading
Loading
Loading
+7 −13
Original line number Diff line number Diff line
@@ -1345,19 +1345,6 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,

        if (isActionMain) {
            if (!internalStateHandled) {
                // Note: There should be at most one log per method call. This is enforced
                // implicitly by using if-else statements.
                UserEventDispatcher ued = getUserEventDispatcher();
                AbstractFloatingView topOpenView = AbstractFloatingView.getTopOpenView(this);
                if (topOpenView != null) {
                    topOpenView.logActionCommand(Action.Command.HOME_INTENT);
                } else if (alreadyOnHome) {
                    Target target = newContainerTarget(mStateManager.getState().containerType);
                    target.pageIndex = mWorkspace.getCurrentPage();
                    ued.logActionCommand(Action.Command.HOME_INTENT, target,
                            newContainerTarget(ContainerType.WORKSPACE));
                }

                // In all these cases, only animate if we're already on home
                AbstractFloatingView.closeAllOpenViews(this, isStarted());

@@ -1377,6 +1364,13 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
                }
            }

            // Handle HOME_INTENT
            UserEventDispatcher ued = getUserEventDispatcher();
            Target target = newContainerTarget(mStateManager.getState().containerType);
            target.pageIndex = mWorkspace.getCurrentPage();
            ued.logActionCommand(Action.Command.HOME_INTENT, target,
                    newContainerTarget(ContainerType.WORKSPACE));

            final View v = getWindow().peekDecorView();
            if (v != null && v.getWindowToken() != null) {
                UiThreadHelper.hideKeyboardAsync(this, v.getWindowToken());
+0 −2
Original line number Diff line number Diff line
@@ -268,8 +268,6 @@ public class LauncherState {
        if (this != NORMAL) {
            LauncherStateManager lsm = launcher.getStateManager();
            LauncherState lastState = lsm.getLastState();
            launcher.getUserEventDispatcher().logActionCommand(Action.Command.BACK,
                    containerType, lastState.containerType);
            lsm.goToState(lastState);
        }
    }