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

Commit 29e8ef36 authored by Becky Qiu's avatar Becky Qiu Committed by android-build-merger
Browse files

Log the right workspace id for -1 screen for stop and resume.

am: bfc2da1f

Change-Id: Iafe8c7cc05d0fb76a3e8768bb8513b4696861c78
parents 213dfabe bfc2da1f
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -875,9 +875,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
        if (mLauncherCallbacks != null) {
            mLauncherCallbacks.onStop();
        }

        getUserEventDispatcher().logActionCommand(Action.Command.STOP,
                mStateManager.getState().containerType, -1);
        logStopAndResume(Action.Command.STOP);

        mAppWidgetHost.setListenIfResumed(false);

@@ -903,8 +901,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,

    private void handleDeferredResume() {
        if (hasBeenResumed() && !mStateManager.getState().disableInteraction) {
            getUserEventDispatcher().logActionCommand(Action.Command.RESUME,
                    mStateManager.getState().containerType, -1);
            logStopAndResume(Action.Command.RESUME);
            getUserEventDispatcher().startSession();

            UiFactory.onLauncherStateOrResumeChanged(this);
@@ -931,6 +928,17 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
        }
    }

    private void logStopAndResume(int command) {
        int containerType = mStateManager.getState().containerType;
        if (containerType == ContainerType.WORKSPACE && mWorkspace != null) {
            getUserEventDispatcher().logActionCommand(command,
                containerType, -1, mWorkspace.isOverlayShown() ? -1 : 0);
        } else {
            getUserEventDispatcher().logActionCommand(command, containerType, -1);
        }

    }

    protected void onStateSet(LauncherState state) {
        getAppWidgetHost().setResumed(state == LauncherState.NORMAL);
        if (mDeferredResumePending) {
+4 −0
Original line number Diff line number Diff line
@@ -3251,6 +3251,10 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
        }
    }

    public boolean isOverlayShown() {
        return mOverlayShown;
    }

    void moveToDefaultScreen() {
        int page = DEFAULT_PAGE;
        if (!workspaceInModalState() && getNextPage() != page) {
+8 −0
Original line number Diff line number Diff line
@@ -187,6 +187,14 @@ public class UserEventDispatcher implements ResourceBasedOverride {
                dstContainerType >=0 ? newContainerTarget(dstContainerType) : null);
    }

    public void logActionCommand(int command, int srcContainerType, int dstContainerType,
                                 int pageIndex) {
        Target srcTarget = newContainerTarget(srcContainerType);
        srcTarget.pageIndex = pageIndex;
        logActionCommand(command, srcTarget,
                dstContainerType >=0 ? newContainerTarget(dstContainerType) : null);
    }

    public void logActionCommand(int command, Target srcTarget, Target dstTarget) {
        LauncherEvent event = newLauncherEvent(newCommandAction(command), srcTarget);
        if (command == Action.Command.STOP) {