Search in sources :

Example 6 with LAUNCHER_STATE_BACKGROUND

use of com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND in project android_packages_apps_404Launcher by P-404.

the class AbsSwipeUpHandler method doLogGesture.

private void doLogGesture(GestureEndTarget endTarget, @Nullable TaskView targetTask) {
    StatsLogManager.EventEnum event;
    switch(endTarget) {
        case HOME:
            event = LAUNCHER_HOME_GESTURE;
            break;
        case RECENTS:
            event = LAUNCHER_OVERVIEW_GESTURE;
            break;
        case LAST_TASK:
        case NEW_TASK:
            event = mLogDirectionUpOrLeft ? LAUNCHER_QUICKSWITCH_LEFT : LAUNCHER_QUICKSWITCH_RIGHT;
            break;
        default:
            event = IGNORE;
    }
    StatsLogger logger = StatsLogManager.newInstance(mContext).logger().withSrcState(LAUNCHER_STATE_BACKGROUND).withDstState(endTarget.containerType);
    if (targetTask != null) {
        logger.withItemInfo(targetTask.getItemInfo());
    }
    DeviceProfile dp = mDp;
    if (dp == null || mDownPos == null) {
        // We probably never received an animation controller, skip logging.
        return;
    }
    int pageIndex = endTarget == LAST_TASK ? LOG_NO_OP_PAGE_INDEX : mRecentsView.getNextPage();
    // TODO: set correct container using the pageIndex
    logger.log(event);
}
Also used : DeviceProfile(com.android.launcher3.DeviceProfile) StatsLogger(com.android.launcher3.logging.StatsLogManager.StatsLogger) StatsLogManager(com.android.launcher3.logging.StatsLogManager)

Example 7 with LAUNCHER_STATE_BACKGROUND

use of com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND in project android_packages_apps_Trebuchet by LineageOS.

the class BaseSwipeUpHandlerV2 method doLogGesture.

private void doLogGesture(GestureEndTarget endTarget) {
    DeviceProfile dp = mDp;
    if (dp == null || mDownPos == null) {
        // We probably never received an animation controller, skip logging.
        return;
    }
    int pageIndex = endTarget == LAST_TASK ? LOG_NO_OP_PAGE_INDEX : mRecentsView.getNextPage();
    UserEventDispatcher.newInstance(mContext).logStateChangeAction(mLogAction, mLogDirection, (int) mDownPos.x, (int) mDownPos.y, ContainerType.NAVBAR, ContainerType.APP, endTarget.containerType, pageIndex);
    StatsLogManager.EventEnum event;
    switch(endTarget) {
        case HOME:
            event = LAUNCHER_HOME_GESTURE;
            break;
        case RECENTS:
            event = LAUNCHER_OVERVIEW_GESTURE;
            break;
        case LAST_TASK:
        case NEW_TASK:
            event = (mLogDirection == Direction.LEFT) ? LAUNCHER_QUICKSWITCH_LEFT : LAUNCHER_QUICKSWITCH_RIGHT;
            break;
        default:
            event = IGNORE;
    }
    ComponentName componentName = mGestureState.getRunningTask().baseActivity;
    StatsLogManager.newInstance(mContext).logger().withSrcState(LAUNCHER_STATE_BACKGROUND).withDstState(StatsLogManager.containerTypeToAtomState(endTarget.containerType)).withItemInfo(getItemInfo(componentName)).log(event);
}
Also used : DeviceProfile(com.android.launcher3.DeviceProfile) ComponentName(android.content.ComponentName) StatsLogManager(com.android.launcher3.logging.StatsLogManager)

Example 8 with LAUNCHER_STATE_BACKGROUND

use of com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND in project android_packages_apps_Launcher3 by AOSPA.

the class AbsSwipeUpHandler method doLogGesture.

private void doLogGesture(GestureEndTarget endTarget, @Nullable TaskView targetTask) {
    StatsLogManager.EventEnum event;
    switch(endTarget) {
        case HOME:
            event = LAUNCHER_HOME_GESTURE;
            break;
        case RECENTS:
            event = LAUNCHER_OVERVIEW_GESTURE;
            break;
        case LAST_TASK:
        case NEW_TASK:
            event = mLogDirectionUpOrLeft ? LAUNCHER_QUICKSWITCH_LEFT : LAUNCHER_QUICKSWITCH_RIGHT;
            break;
        default:
            event = IGNORE;
    }
    StatsLogger logger = StatsLogManager.newInstance(mContext).logger().withSrcState(LAUNCHER_STATE_BACKGROUND).withDstState(endTarget.containerType);
    if (targetTask != null) {
        logger.withItemInfo(targetTask.getItemInfo());
    }
    DeviceProfile dp = mDp;
    if (dp == null || mDownPos == null) {
        // We probably never received an animation controller, skip logging.
        return;
    }
    int pageIndex = endTarget == LAST_TASK ? LOG_NO_OP_PAGE_INDEX : mRecentsView.getNextPage();
    // TODO: set correct container using the pageIndex
    logger.log(event);
}
Also used : DeviceProfile(com.android.launcher3.DeviceProfile) StatsLogger(com.android.launcher3.logging.StatsLogManager.StatsLogger) StatsLogManager(com.android.launcher3.logging.StatsLogManager)

Example 9 with LAUNCHER_STATE_BACKGROUND

use of com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND in project android_packages_apps_Launcher3 by ArrowOS.

the class OverviewWithoutFocusInputConsumer method onSwipeUp.

@Override
public void onSwipeUp(boolean wasFling, PointF finalVelocity) {
    try {
        mContext.startActivity(mGestureState.getHomeIntent());
    } catch (NullPointerException | ActivityNotFoundException | SecurityException e) {
        mContext.startActivity(createHomeIntent());
    }
    ActiveGestureLog.INSTANCE.addLog("startQuickstep");
    BaseActivity activity = BaseDraggingActivity.fromContext(mContext);
    int state = (mGestureState != null && mGestureState.getEndTarget() != null) ? mGestureState.getEndTarget().containerType : LAUNCHER_STATE_HOME;
    activity.getStatsLogManager().logger().withSrcState(LAUNCHER_STATE_BACKGROUND).withDstState(state).withContainerInfo(LauncherAtom.ContainerInfo.newBuilder().setWorkspace(LauncherAtom.WorkspaceContainer.newBuilder().setPageIndex(-1)).build()).log(LAUNCHER_HOME_GESTURE);
}
Also used : ActivityNotFoundException(android.content.ActivityNotFoundException) BaseActivity(com.android.launcher3.BaseActivity)

Example 10 with LAUNCHER_STATE_BACKGROUND

use of com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND in project android_packages_apps_Launcher3 by ProtonAOSP.

the class AbsSwipeUpHandler method doLogGesture.

private void doLogGesture(GestureEndTarget endTarget, @Nullable TaskView targetTask) {
    StatsLogManager.EventEnum event;
    switch(endTarget) {
        case HOME:
            event = LAUNCHER_HOME_GESTURE;
            break;
        case RECENTS:
            event = LAUNCHER_OVERVIEW_GESTURE;
            break;
        case LAST_TASK:
        case NEW_TASK:
            event = mLogDirectionUpOrLeft ? LAUNCHER_QUICKSWITCH_LEFT : LAUNCHER_QUICKSWITCH_RIGHT;
            break;
        default:
            event = IGNORE;
    }
    StatsLogger logger = StatsLogManager.newInstance(mContext).logger().withSrcState(LAUNCHER_STATE_BACKGROUND).withDstState(endTarget.containerType);
    if (targetTask != null) {
        logger.withItemInfo(targetTask.getItemInfo());
    }
    DeviceProfile dp = mDp;
    if (dp == null || mDownPos == null) {
        // We probably never received an animation controller, skip logging.
        return;
    }
    int pageIndex = endTarget == LAST_TASK ? LOG_NO_OP_PAGE_INDEX : mRecentsView.getNextPage();
    // TODO: set correct container using the pageIndex
    logger.log(event);
}
Also used : DeviceProfile(com.android.launcher3.DeviceProfile) StatsLogger(com.android.launcher3.logging.StatsLogManager.StatsLogger) StatsLogManager(com.android.launcher3.logging.StatsLogManager)

Aggregations

DeviceProfile (com.android.launcher3.DeviceProfile)6 StatsLogManager (com.android.launcher3.logging.StatsLogManager)6 ActivityNotFoundException (android.content.ActivityNotFoundException)5 BaseActivity (com.android.launcher3.BaseActivity)5 StatsLogger (com.android.launcher3.logging.StatsLogManager.StatsLogger)5 ComponentName (android.content.ComponentName)1