Fix task selection logic

When task was selected for activity launched with flag FLAG_ACTIVITY_NEW_TASK
first matching task was omitted if there was another match lower in stack.
This lead to task shuffling in same stack.

Bug: 28848683
Change-Id: I94e55693fc7ed926fc151ba988d257bd2417dd45
diff --git a/services/core/java/com/android/server/am/TaskRecord.java b/services/core/java/com/android/server/am/TaskRecord.java
index 578fc44..8932e4b 100644
--- a/services/core/java/com/android/server/am/TaskRecord.java
+++ b/services/core/java/com/android/server/am/TaskRecord.java
@@ -492,10 +492,10 @@
     }
 
     /**
-     * Return true if the input activity has the same intent resolution as the intent this task
+     * Return true if the input activity has the same intent filter as the intent this task
      * record is based on (normally the root activity intent).
      */
-    boolean isSameIntentResolution(ActivityRecord r) {
+    boolean isSameIntentFilter(ActivityRecord r) {
         final Intent intent = new Intent(r.intent);
         // Correct the activity intent for aliasing. The task record intent will always be based on
         // the real activity that will be launched not the alias, so we need to use an intent with