Search in sources :

Example 1 with LAUNCHER_STATE_BACKGROUND

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

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 2 with LAUNCHER_STATE_BACKGROUND

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

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 3 with LAUNCHER_STATE_BACKGROUND

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

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 4 with LAUNCHER_STATE_BACKGROUND

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

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 5 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 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)

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