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

Commit 235c0056 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Disallow reparenting into a leaf task." into main

parents e42f3d9b 148771ef
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1338,6 +1338,15 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
                    if (isLockTaskModeViolation(wc.getParent(), wc.asTask(), isInLockTaskMode)) {
                        break;
                    }
                }  else if (type == HIERARCHY_OP_TYPE_REPARENT && hop.getNewParent() != null) {
                    final WindowContainer parentWc = WindowContainer.fromBinder(hop.getNewParent());
                    final Task parentTask = parentWc != null ? parentWc.asTask() : null;
                    if (parentTask != null && parentTask.isLeafTask()
                            && parentTask.hasDirectChildActivities()) {
                        Slog.w(TAG, "Skip applying hierarchy operation " + hop
                                + " on a leaf task.");
                        break;
                    }
                }
                if (syncId >= 0) {
                    addToSyncSet(syncId, wc);