Merge "Fix crashes related to WCT for ARC T" into udc-qpr-dev

This commit is contained in:
Treehugger Robot
2023-08-15 03:29:39 +00:00
committed by Android (Google) Code Review
2 changed files with 20 additions and 6 deletions

View File

@@ -2878,8 +2878,8 @@ class Task extends TaskFragment {
// No need to check if allowed if it's leaving dragResize
if (dragResizing
&& !(getRootTask().getWindowingMode() == WINDOWING_MODE_FREEFORM)) {
throw new IllegalArgumentException("Drag resize not allow for root task id="
+ getRootTaskId());
Slog.e(TAG, "Drag resize isn't allowed for root task id=" + getRootTaskId());
return;
}
mDragResizing = dragResizing;
resetDragResizingChangeReported();

View File

@@ -1657,9 +1657,18 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
}
private int setAdjacentRootsHierarchyOp(WindowContainerTransaction.HierarchyOp hop) {
final TaskFragment root1 = WindowContainer.fromBinder(hop.getContainer()).asTaskFragment();
final TaskFragment root2 =
WindowContainer.fromBinder(hop.getAdjacentRoot()).asTaskFragment();
final WindowContainer wc1 = WindowContainer.fromBinder(hop.getContainer());
if (wc1 == null || !wc1.isAttached()) {
Slog.e(TAG, "Attempt to operate on unknown or detached container: " + wc1);
return TRANSACT_EFFECTS_NONE;
}
final TaskFragment root1 = wc1.asTaskFragment();
final WindowContainer wc2 = WindowContainer.fromBinder(hop.getAdjacentRoot());
if (wc2 == null || !wc2.isAttached()) {
Slog.e(TAG, "Attempt to operate on unknown or detached container: " + wc2);
return TRANSACT_EFFECTS_NONE;
}
final TaskFragment root2 = wc2.asTaskFragment();
if (!root1.mCreatedByOrganizer || !root2.mCreatedByOrganizer) {
throw new IllegalArgumentException("setAdjacentRootsHierarchyOp: Not created by"
+ " organizer root1=" + root1 + " root2=" + root2);
@@ -1672,7 +1681,12 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
}
private int clearAdjacentRootsHierarchyOp(WindowContainerTransaction.HierarchyOp hop) {
final TaskFragment root = WindowContainer.fromBinder(hop.getContainer()).asTaskFragment();
final WindowContainer wc = WindowContainer.fromBinder(hop.getContainer());
if (wc == null || !wc.isAttached()) {
Slog.e(TAG, "Attempt to operate on unknown or detached container: " + wc);
return TRANSACT_EFFECTS_NONE;
}
final TaskFragment root = wc.asTaskFragment();
if (!root.mCreatedByOrganizer) {
throw new IllegalArgumentException("clearAdjacentRootsHierarchyOp: Not created by"
+ " organizer root=" + root);