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

Commit 4ece098f authored by Andy Chou's avatar Andy Chou
Browse files

Launch activity if click on a TaskView which has the task running on

different display wit root.

If click on the TaskView which has the task running on differnt display
with root, it means we are trying to pull the task to the root display.
So we should also launch the activity to the right display even it is in
live tile mode.
Also add null check for getRootViewDisplayId().

Bug: 207085426
Bug: 210075742
Test: manual test with app streaming wit phonehub notification
Change-Id: Icdaa6dfa26345d271f3505a0226cf434696f40da
parent cbf9369f
Loading
Loading
Loading
Loading
+8 −1
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@


package com.android.quickstep.views;
package com.android.quickstep.views;


import static android.view.Display.DEFAULT_DISPLAY;
import static android.widget.Toast.LENGTH_SHORT;
import static android.widget.Toast.LENGTH_SHORT;


import static com.android.launcher3.AbstractFloatingView.TYPE_TASK_MENU;
import static com.android.launcher3.AbstractFloatingView.TYPE_TASK_MENU;
@@ -51,6 +52,7 @@ import android.os.Bundle;
import android.util.AttributeSet;
import android.util.AttributeSet;
import android.util.FloatProperty;
import android.util.FloatProperty;
import android.util.Log;
import android.util.Log;
import android.view.Display;
import android.view.MotionEvent;
import android.view.MotionEvent;
import android.view.TouchDelegate;
import android.view.TouchDelegate;
import android.view.View;
import android.view.View;
@@ -636,6 +638,7 @@ public class TaskView extends FrameLayout implements Reusable {
                // If the recents animation is cancelled somehow between the parent if block and
                // If the recents animation is cancelled somehow between the parent if block and
                // here, try to launch the task as a non live tile task.
                // here, try to launch the task as a non live tile task.
                launchTaskAnimated();
                launchTaskAnimated();
                mIsClickableAsLiveTile = true;
                return;
                return;
            }
            }


@@ -657,6 +660,9 @@ public class TaskView extends FrameLayout implements Reusable {


                @Override
                @Override
                public void onAnimationEnd(Animator animator) {
                public void onAnimationEnd(Animator animator) {
                    if (mTask != null && mTask.key.displayId != getRootViewDisplayId()) {
                        launchTaskAnimated();
                    }
                    mIsClickableAsLiveTile = true;
                    mIsClickableAsLiveTile = true;
                }
                }
            });
            });
@@ -1517,7 +1523,8 @@ public class TaskView extends FrameLayout implements Reusable {




    private int getRootViewDisplayId() {
    private int getRootViewDisplayId() {
        return getRootView().getDisplay().getDisplayId();
        Display  display = getRootView().getDisplay();
        return display != null ? display.getDisplayId() : DEFAULT_DISPLAY;
    }
    }


    /**
    /**