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

Commit 83c1b07a authored by Winson's avatar Winson
Browse files

Fixing issue with wrong transition when tasks are offscreen.

- Fixing issue with wrong animation specs being created for tasks that
  are offscreen
- Removing unused code and simplifying the logic for task launching, also
  pulling this out into another file so that it is easier to read and
  understand
- Removing old incorrect call to moveTaskToFront() instead of
  startActivityFromRecents()

Bug: 25590404

Change-Id: I25d9530d089a7984fb8c94954a34dd124420755a
parent 142af42f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -386,8 +386,8 @@ public class Recents extends SystemUI
     * Handle screen pinning request.
     */
    public final void onBusEvent(final ScreenPinningRequestEvent event) {
        int processUser = event.systemServicesProxy.getProcessUser();
        if (event.systemServicesProxy.isSystemUser(processUser)) {
        int processUser = sSystemServicesProxy.getProcessUser();
        if (sSystemServicesProxy.isSystemUser(processUser)) {
            mImpl.onStartScreenPinning(event.applicationContext);
        } else {
            postToSystemUser(new Runnable() {
+14 −7
Original line number Diff line number Diff line
@@ -46,6 +46,8 @@ import com.android.systemui.recents.events.activity.EnterRecentsWindowAnimationS
import com.android.systemui.recents.events.activity.EnterRecentsWindowLastAnimationFrameEvent;
import com.android.systemui.recents.events.activity.HideRecentsEvent;
import com.android.systemui.recents.events.activity.IterateRecentsEvent;
import com.android.systemui.recents.events.activity.LaunchTaskFailedEvent;
import com.android.systemui.recents.events.activity.LaunchTaskSucceededEvent;
import com.android.systemui.recents.events.activity.ToggleRecentsEvent;
import com.android.systemui.recents.events.component.RecentsVisibilityChangedEvent;
import com.android.systemui.recents.events.component.ScreenPinningRequestEvent;
@@ -108,7 +110,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
    DozeTrigger mIterateTrigger = new DozeTrigger(500, new Runnable() {
        @Override
        public void run() {
            boolean dismissed = dismissRecentsToFocusedTask(false);
            dismissRecentsToFocusedTask(false);
        }
    });

@@ -568,12 +570,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView

    /**** RecentsView.RecentsViewCallbacks Implementation ****/

    @Override
    public void onTaskLaunchFailed() {
        // Return to Home
        dismissRecentsToHome(true);
    }

    @Override
    public void onAllTaskViewsDismissed() {
        mFinishLaunchHomeRunnable.run();
@@ -701,6 +697,17 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_BEHIND);
    }

    public final void onBusEvent(LaunchTaskSucceededEvent event) {
        MetricsLogger.histogram(this, "overview_task_launch_index", event.taskIndexFromStackFront);
    }

    public final void onBusEvent(LaunchTaskFailedEvent event) {
        // Return to Home
        dismissRecentsToHome(true);

        MetricsLogger.count(this, "overview_task_launch_failed", 1);
    }

    public final void onBusEvent(ScreenPinningRequestEvent event) {
        MetricsLogger.count(this, "overview_screen_pinned", 1);
    }
+1 −6
Original line number Diff line number Diff line
@@ -503,13 +503,8 @@ public class RecentsImpl extends IRecentsNonSystemUserCallbacks.Stub
        MetricsLogger.count(mContext, "overview_affiliated_task_launch", 1);

        // Launch the task
        if (toTask.isActive) {
            // Bring an active task to the foreground
            ssp.moveTaskToFront(toTask.key.id, launchOpts);
        } else {
        ssp.startActivityFromRecents(mContext, toTask.key.id, toTask.activityLabel, launchOpts);
    }
    }

    public void showNextAffiliatedTask() {
        // Keep track of when the affiliated task is triggered
+26 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2015 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.recents.events.activity;

import com.android.systemui.recents.events.EventBus;

/**
 * This is sent when we fail to launch a task.
 */
public class LaunchTaskFailedEvent extends EventBus.Event {
    // Simple event
}
+31 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2015 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.recents.events.activity;

import com.android.systemui.recents.events.EventBus;

/**
 * This is sent when we successfully launch a task.
 */
public class LaunchTaskSucceededEvent extends EventBus.Event {

    public final int taskIndexFromStackFront;

    public LaunchTaskSucceededEvent(int taskIndexFromStackFront) {
        this.taskIndexFromStackFront = taskIndexFromStackFront;
    }
}
Loading