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

Commit 0cf8519d authored by Louis Chang's avatar Louis Chang Committed by Automerger Merge Worker
Browse files

Merge "Return the activity type of any child activity in the Task" into tm-dev...

Merge "Return the activity type of any child activity in the Task" into tm-dev am: 2b8d1c35 am: d965aa41

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18527308



Change-Id: I98e260084f071704f00d4b7f07a006b73341d107
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents f977eef1 d965aa41
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -103,7 +103,6 @@ import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashMap;
import java.util.List;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.function.Predicate;
@@ -1758,7 +1757,7 @@ class TaskFragment extends WindowContainer<WindowContainer> {
        final Task task = isAddingActivity ? getTask() : null;
        final Task task = isAddingActivity ? getTask() : null;


        // If this task had any activity before we added this one.
        // If this task had any activity before we added this one.
        boolean taskHadActivity = task != null && task.getActivity(Objects::nonNull) != null;
        boolean taskHadActivity = task != null && task.getTopMostActivity() != null;
        // getActivityType() looks at the top child, so we need to read the type before adding
        // getActivityType() looks at the top child, so we need to read the type before adding
        // a new child in case the new child is on top and UNDEFINED.
        // a new child in case the new child is on top and UNDEFINED.
        final int activityType = task != null ? task.getActivityType() : ACTIVITY_TYPE_UNDEFINED;
        final int activityType = task != null ? task.getActivityType() : ACTIVITY_TYPE_UNDEFINED;
@@ -2171,7 +2170,7 @@ class TaskFragment extends WindowContainer<WindowContainer> {
        if (applicationType != ACTIVITY_TYPE_UNDEFINED || !hasChild()) {
        if (applicationType != ACTIVITY_TYPE_UNDEFINED || !hasChild()) {
            return applicationType;
            return applicationType;
        }
        }
        final ActivityRecord activity = getTopNonFinishingActivity();
        final ActivityRecord activity = getTopMostActivity();
        return activity != null ? activity.getActivityType() : getTopChild().getActivityType();
        return activity != null ? activity.getActivityType() : getTopChild().getActivityType();
    }
    }