diff options
| author | 2019-02-19 04:08:26 +0000 | |
|---|---|---|
| committer | 2019-02-19 04:08:26 +0000 | |
| commit | bee38836064a48d2dbd3f34e506b18c3248feea4 (patch) | |
| tree | 59f6b96f07774dd70f8c45d398aa148be610e683 | |
| parent | d8b240cbb01278ba8f78f45ff798919ae20866ca (diff) | |
| parent | 78f544187933d2e5f5028f0af6e515963b1dabb9 (diff) | |
Merge "Suppress the warning toast if the preferredDisplay was set to singleTask"
| -rw-r--r-- | services/core/java/com/android/server/wm/ActivityStackSupervisor.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityStackSupervisor.java b/services/core/java/com/android/server/wm/ActivityStackSupervisor.java index 0a3c2fba3930..c685b05e99e0 100644 --- a/services/core/java/com/android/server/wm/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/wm/ActivityStackSupervisor.java @@ -2332,6 +2332,20 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { if (!task.canBeLaunchedOnDisplay(actualDisplayId)) { throw new IllegalStateException("Task resolved to incompatible display"); } + + final ActivityDisplay preferredDisplay = + mRootActivityContainer.getActivityDisplay(preferredDisplayId); + + final boolean singleTaskInstance = preferredDisplay != null + && preferredDisplay.isSingleTaskInstance(); + + if (singleTaskInstance) { + // Suppress the warning toast if the preferredDisplay was set to singleTask. + // The singleTaskInstance displays will only contain one task and any attempt to + // launch new task will re-route to the default display. + return; + } + if (preferredDisplayId != actualDisplayId) { Slog.w(TAG, "Failed to put " + task + " on display " + preferredDisplayId); // Display a warning toast that we failed to put a task on a secondary display. |