Search in sources :

Example 1 with LaunchTaskFailedEvent

use of com.android.systemui.recents.events.activity.LaunchTaskFailedEvent in project android_frameworks_base by ResurrectionRemix.

the class RecentsTransitionHelper method startTaskActivity.

/**
     * Starts the activity for the launch task.
     *
     * @param taskView this is the {@link TaskView} that we are launching from. This can be null if
     *                 we are toggling recents and the launch-to task is now offscreen.
     */
private void startTaskActivity(TaskStack stack, Task task, @Nullable TaskView taskView, ActivityOptions opts, IAppTransitionAnimationSpecsFuture transitionFuture, final ActivityOptions.OnAnimationStartedListener animStartedListener) {
    SystemServicesProxy ssp = Recents.getSystemServices();
    if (ssp.startActivityFromRecents(mContext, task.key, task.title, opts)) {
        // Keep track of the index of the task launch
        int taskIndexFromFront = 0;
        int taskIndex = stack.indexOfStackTask(task);
        if (taskIndex > -1) {
            taskIndexFromFront = stack.getTaskCount() - taskIndex - 1;
        }
        EventBus.getDefault().send(new LaunchTaskSucceededEvent(taskIndexFromFront));
    } else {
        // Dismiss the task if we fail to launch it
        if (taskView != null) {
            taskView.dismissTask();
        }
        // Keep track of failed launches
        EventBus.getDefault().send(new LaunchTaskFailedEvent());
    }
    if (transitionFuture != null) {
        ssp.overridePendingAppTransitionMultiThumbFuture(transitionFuture, wrapStartedListener(animStartedListener), true);
    }
}
Also used : SystemServicesProxy(com.android.systemui.recents.misc.SystemServicesProxy) LaunchTaskSucceededEvent(com.android.systemui.recents.events.activity.LaunchTaskSucceededEvent) LaunchTaskFailedEvent(com.android.systemui.recents.events.activity.LaunchTaskFailedEvent)

Example 2 with LaunchTaskFailedEvent

use of com.android.systemui.recents.events.activity.LaunchTaskFailedEvent in project platform_frameworks_base by android.

the class RecentsTransitionHelper method startTaskActivity.

/**
     * Starts the activity for the launch task.
     *
     * @param taskView this is the {@link TaskView} that we are launching from. This can be null if
     *                 we are toggling recents and the launch-to task is now offscreen.
     */
private void startTaskActivity(TaskStack stack, Task task, @Nullable TaskView taskView, ActivityOptions opts, IAppTransitionAnimationSpecsFuture transitionFuture, final ActivityOptions.OnAnimationStartedListener animStartedListener) {
    SystemServicesProxy ssp = Recents.getSystemServices();
    if (ssp.startActivityFromRecents(mContext, task.key, task.title, opts)) {
        // Keep track of the index of the task launch
        int taskIndexFromFront = 0;
        int taskIndex = stack.indexOfStackTask(task);
        if (taskIndex > -1) {
            taskIndexFromFront = stack.getTaskCount() - taskIndex - 1;
        }
        EventBus.getDefault().send(new LaunchTaskSucceededEvent(taskIndexFromFront));
    } else {
        // Dismiss the task if we fail to launch it
        if (taskView != null) {
            taskView.dismissTask();
        }
        // Keep track of failed launches
        EventBus.getDefault().send(new LaunchTaskFailedEvent());
    }
    if (transitionFuture != null) {
        ssp.overridePendingAppTransitionMultiThumbFuture(transitionFuture, wrapStartedListener(animStartedListener), true);
    }
}
Also used : SystemServicesProxy(com.android.systemui.recents.misc.SystemServicesProxy) LaunchTaskSucceededEvent(com.android.systemui.recents.events.activity.LaunchTaskSucceededEvent) LaunchTaskFailedEvent(com.android.systemui.recents.events.activity.LaunchTaskFailedEvent)

Example 3 with LaunchTaskFailedEvent

use of com.android.systemui.recents.events.activity.LaunchTaskFailedEvent in project android_frameworks_base by AOSPA.

the class RecentsTransitionHelper method startTaskActivity.

/**
     * Starts the activity for the launch task.
     *
     * @param taskView this is the {@link TaskView} that we are launching from. This can be null if
     *                 we are toggling recents and the launch-to task is now offscreen.
     */
private void startTaskActivity(TaskStack stack, Task task, @Nullable TaskView taskView, ActivityOptions opts, IAppTransitionAnimationSpecsFuture transitionFuture, final ActivityOptions.OnAnimationStartedListener animStartedListener) {
    SystemServicesProxy ssp = Recents.getSystemServices();
    if (ssp.startActivityFromRecents(mContext, task.key, task.title, opts)) {
        // Keep track of the index of the task launch
        int taskIndexFromFront = 0;
        int taskIndex = stack.indexOfStackTask(task);
        if (taskIndex > -1) {
            taskIndexFromFront = stack.getTaskCount() - taskIndex - 1;
        }
        EventBus.getDefault().send(new LaunchTaskSucceededEvent(taskIndexFromFront));
    } else {
        // Dismiss the task if we fail to launch it
        if (taskView != null) {
            taskView.dismissTask();
        }
        // Keep track of failed launches
        EventBus.getDefault().send(new LaunchTaskFailedEvent());
    }
    if (transitionFuture != null) {
        ssp.overridePendingAppTransitionMultiThumbFuture(transitionFuture, wrapStartedListener(animStartedListener), true);
    }
}
Also used : SystemServicesProxy(com.android.systemui.recents.misc.SystemServicesProxy) LaunchTaskSucceededEvent(com.android.systemui.recents.events.activity.LaunchTaskSucceededEvent) LaunchTaskFailedEvent(com.android.systemui.recents.events.activity.LaunchTaskFailedEvent)

Example 4 with LaunchTaskFailedEvent

use of com.android.systemui.recents.events.activity.LaunchTaskFailedEvent in project android_frameworks_base by DirtyUnicorns.

the class RecentsTransitionHelper method startTaskActivity.

/**
     * Starts the activity for the launch task.
     *
     * @param taskView this is the {@link TaskView} that we are launching from. This can be null if
     *                 we are toggling recents and the launch-to task is now offscreen.
     */
private void startTaskActivity(TaskStack stack, Task task, @Nullable TaskView taskView, ActivityOptions opts, IAppTransitionAnimationSpecsFuture transitionFuture, final ActivityOptions.OnAnimationStartedListener animStartedListener) {
    SystemServicesProxy ssp = Recents.getSystemServices();
    if (ssp.startActivityFromRecents(mContext, task.key, task.title, opts)) {
        // Keep track of the index of the task launch
        int taskIndexFromFront = 0;
        int taskIndex = stack.indexOfStackTask(task);
        if (taskIndex > -1) {
            taskIndexFromFront = stack.getTaskCount() - taskIndex - 1;
        }
        EventBus.getDefault().send(new LaunchTaskSucceededEvent(taskIndexFromFront));
    } else {
        // Dismiss the task if we fail to launch it
        if (taskView != null) {
            taskView.dismissTask();
        }
        // Keep track of failed launches
        EventBus.getDefault().send(new LaunchTaskFailedEvent());
    }
    if (transitionFuture != null) {
        ssp.overridePendingAppTransitionMultiThumbFuture(transitionFuture, wrapStartedListener(animStartedListener), true);
    }
}
Also used : SystemServicesProxy(com.android.systemui.recents.misc.SystemServicesProxy) LaunchTaskSucceededEvent(com.android.systemui.recents.events.activity.LaunchTaskSucceededEvent) LaunchTaskFailedEvent(com.android.systemui.recents.events.activity.LaunchTaskFailedEvent)

Example 5 with LaunchTaskFailedEvent

use of com.android.systemui.recents.events.activity.LaunchTaskFailedEvent in project android_frameworks_base by crdroidandroid.

the class RecentsTransitionHelper method startTaskActivity.

/**
     * Starts the activity for the launch task.
     *
     * @param taskView this is the {@link TaskView} that we are launching from. This can be null if
     *                 we are toggling recents and the launch-to task is now offscreen.
     */
private void startTaskActivity(TaskStack stack, Task task, @Nullable TaskView taskView, ActivityOptions opts, IAppTransitionAnimationSpecsFuture transitionFuture, final ActivityOptions.OnAnimationStartedListener animStartedListener) {
    SystemServicesProxy ssp = Recents.getSystemServices();
    if (ssp.startActivityFromRecents(mContext, task.key, task.title, opts)) {
        // Keep track of the index of the task launch
        int taskIndexFromFront = 0;
        int taskIndex = stack.indexOfStackTask(task);
        if (taskIndex > -1) {
            taskIndexFromFront = stack.getTaskCount() - taskIndex - 1;
        }
        EventBus.getDefault().send(new LaunchTaskSucceededEvent(taskIndexFromFront));
    } else {
        // Dismiss the task if we fail to launch it
        if (taskView != null) {
            taskView.dismissTask();
        }
        // Keep track of failed launches
        EventBus.getDefault().send(new LaunchTaskFailedEvent());
    }
    if (transitionFuture != null) {
        ssp.overridePendingAppTransitionMultiThumbFuture(transitionFuture, wrapStartedListener(animStartedListener), true);
    }
}
Also used : SystemServicesProxy(com.android.systemui.recents.misc.SystemServicesProxy) LaunchTaskSucceededEvent(com.android.systemui.recents.events.activity.LaunchTaskSucceededEvent) LaunchTaskFailedEvent(com.android.systemui.recents.events.activity.LaunchTaskFailedEvent)

Aggregations

LaunchTaskFailedEvent (com.android.systemui.recents.events.activity.LaunchTaskFailedEvent)5 LaunchTaskSucceededEvent (com.android.systemui.recents.events.activity.LaunchTaskSucceededEvent)5 SystemServicesProxy (com.android.systemui.recents.misc.SystemServicesProxy)5