From d39583af0e7b466d76cce1f367223a678bc20dac Mon Sep 17 00:00:00 2001 From: Hongwei Wang Date: Wed, 4 Mar 2020 11:14:32 -0800 Subject: Start PiP dismiss from SysUI via TaskOrganizer following ag/10570572, dismiss PiP is driven by SysUI as following - SysUI issues WindowContainerTransaction and set the child windowing mode at the beginning - SysUI continues the animation - SysUI issues WindowContainerTransaction and set the final windowing mode at the end This solves also the black background issue while exiting from PiP to fullscreen mode. Known issues - app does not receive fullscreen configuration when transitioning from PiP to fullscreen mode - saving of the reentry bounds should be originated from SysUI rather than WM going forward Bug: 149947030 Bug: 151866274 Test: atest PinnedStackTests PipAnimationControllerTest Change-Id: I7ed0d8b47dcc26653ebe2f3c08acab9e8b835db4 --- .../server/wm/ActivityTaskManagerService.java | 32 +--------------------- .../src/com/android/server/wm/RecentTasksTest.java | 1 - 2 files changed, 1 insertion(+), 32 deletions(-) (limited to 'services') diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java index 214a6767f3b2..14c82b3f07f1 100644 --- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java +++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java @@ -144,7 +144,6 @@ import android.app.IApplicationThread; import android.app.IAssistDataReceiver; import android.app.INotificationManager; import android.app.IRequestFinishCallback; -import android.window.ITaskOrganizerController; import android.app.ITaskStackListener; import android.app.Notification; import android.app.NotificationManager; @@ -230,9 +229,9 @@ import android.util.proto.ProtoOutputStream; import android.view.IRecentsAnimationRunner; import android.view.RemoteAnimationAdapter; import android.view.RemoteAnimationDefinition; +import android.view.WindowManager; import android.window.IWindowOrganizerController; import android.window.WindowContainerTransaction; -import android.view.WindowManager; import com.android.internal.R; import com.android.internal.annotations.VisibleForTesting; @@ -3979,35 +3978,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } } - /** - * Dismisses Pip - * @param animate True if the dismissal should be animated. - * @param animationDuration The duration of the resize animation in milliseconds or -1 if the - * default animation duration should be used. - */ - @Override - public void dismissPip(boolean animate, int animationDuration) { - enforceCallerIsRecentsOrHasPermission(MANAGE_ACTIVITY_STACKS, "dismissPip()"); - final long ident = Binder.clearCallingIdentity(); - try { - synchronized (mGlobalLock) { - final ActivityStack stack = - mRootWindowContainer.getDefaultDisplay().getRootPinnedTask(); - if (stack == null) { - Slog.w(TAG, "dismissPip: pinned stack not found."); - return; - } - if (stack.getWindowingMode() != WINDOWING_MODE_PINNED) { - throw new IllegalArgumentException("Stack: " + stack - + " doesn't support animated resize."); - } - stack.dismissPip(); - } - } finally { - Binder.restoreCallingIdentity(ident); - } - } - @Override public void suppressResizeConfigChanges(boolean suppress) throws RemoteException { mAmInternal.enforceCallingPermission(MANAGE_ACTIVITY_STACKS, "suppressResizeConfigChanges()"); diff --git a/services/tests/wmtests/src/com/android/server/wm/RecentTasksTest.java b/services/tests/wmtests/src/com/android/server/wm/RecentTasksTest.java index 66566bc5dff5..0dee6f3791ff 100644 --- a/services/tests/wmtests/src/com/android/server/wm/RecentTasksTest.java +++ b/services/tests/wmtests/src/com/android/server/wm/RecentTasksTest.java @@ -1115,7 +1115,6 @@ public class RecentTasksTest extends ActivityTestsBase { () -> mService.moveTaskToStack(0, INVALID_STACK_ID, true)); assertSecurityException(expectCallable, () -> mService.setTaskWindowingModeSplitScreenPrimary(0, true)); - assertSecurityException(expectCallable, () -> mService.dismissPip(true, 0)); assertSecurityException(expectCallable, () -> mService.moveTopActivityToPinnedStack(INVALID_STACK_ID, new Rect())); assertSecurityException(expectCallable, () -> mService.getAllStackInfos()); -- cgit v1.2.3-59-g8ed1b