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

Commit e1b53c90 authored by Charles Chen's avatar Charles Chen
Browse files

Only allow resizeable Activity to create TaskFragment

TaskFragment is usually occupied a portion of the owner Task.
Using a non-resizable Activity limits the ability to resize
Activity within TaskFragment. This CL prohibits non-resizeable
Activity to create TaskFragment.

Test: TaskFragmentOrganizerPolicyTests
Bug: 199689901
Change-Id: I10ebfc90de1b571466b048400696061df1bc0206
parent 9c053702
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1177,6 +1177,12 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
            sendTaskFragmentOperationFailure(organizer, errorCallbackToken, exception);
            return;
        }
        if (!ownerActivity.isResizeable()) {
            final IllegalArgumentException exception = new IllegalArgumentException("Not allowed"
                    + " to operate with non-resizable owner Activity");
            sendTaskFragmentOperationFailure(organizer, errorCallbackToken, exception);
            return;
        }
        // The ownerActivity has to belong to the same app as the root Activity of the target Task.
        final ActivityRecord rootActivity = ownerActivity.getTask().getRootActivity();
        if (rootActivity.getUid() != ownerActivity.getUid()) {