From 6a06d8615f24769381e340a544c71d56a79ff25c Mon Sep 17 00:00:00 2001 From: Iris Yang Date: Thu, 17 Feb 2022 03:20:37 +0000 Subject: [PATCH] Get display id from display instead of the display of root view Since `getRootView()` will increase the execution time, use `getDisplay()` instead. Bug: 202825727 Test: manually Change-Id: I22ef58cb39716433cd8e91200837ab49229ae3e1 --- quickstep/src/com/android/quickstep/views/TaskView.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java index cdb8082da7..394902702c 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/src/com/android/quickstep/views/TaskView.java @@ -699,7 +699,8 @@ public class TaskView extends FrameLayout implements Reusable { TestLogging.recordEvent( TestProtocol.SEQUENCE_MAIN, "startActivityFromRecentsAsync", mTask); ActivityOptionsWrapper opts = mActivity.getActivityLaunchOptions(this, null); - opts.options.setLaunchDisplayId(getRootViewDisplayId()); + opts.options.setLaunchDisplayId( + getDisplay() == null ? DEFAULT_DISPLAY : getDisplay().getDisplayId()); if (ActivityManagerWrapper.getInstance() .startActivityFromRecents(mTask.key, opts.options)) { RecentsView recentsView = getRecentsView(); @@ -740,7 +741,8 @@ public class TaskView extends FrameLayout implements Reusable { // Indicate success once the system has indicated that the transition has started ActivityOptions opts = ActivityOptionsCompat.makeCustomAnimation( getContext(), 0, 0, () -> callback.accept(true), MAIN_EXECUTOR.getHandler()); - opts.setLaunchDisplayId(getRootViewDisplayId()); + opts.setLaunchDisplayId( + getDisplay() == null ? DEFAULT_DISPLAY : getDisplay().getDisplayId()); if (freezeTaskList) { ActivityOptionsCompat.setFreezeRecentTasksList(opts); }