Merge "Provide mandatory gesture insets from the shell caption" into udc-qpr-dev am: ece7006fb0

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

Change-Id: Ic56a99de9469a0254681cc3fee08f912a7c9d281
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Yunfan Chen
2023-05-30 04:48:24 +00:00
committed by Automerger Merge Worker
2 changed files with 7 additions and 1 deletions

View File

@@ -248,6 +248,9 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer>
mCaptionInsetsRect.bottom = mCaptionInsetsRect.top + captionHeight + params.mCaptionY; mCaptionInsetsRect.bottom = mCaptionInsetsRect.top + captionHeight + params.mCaptionY;
wct.addInsetsSource(mTaskInfo.token, wct.addInsetsSource(mTaskInfo.token,
mOwner, 0 /* index */, WindowInsets.Type.captionBar(), mCaptionInsetsRect); mOwner, 0 /* index */, WindowInsets.Type.captionBar(), mCaptionInsetsRect);
wct.addInsetsSource(mTaskInfo.token,
mOwner, 0 /* index */, WindowInsets.Type.mandatorySystemGestures(),
mCaptionInsetsRect);
} else { } else {
startT.hide(mCaptionContainerSurface); startT.hide(mCaptionContainerSurface);
} }
@@ -345,6 +348,8 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer>
final WindowContainerTransaction wct = mWindowContainerTransactionSupplier.get(); final WindowContainerTransaction wct = mWindowContainerTransactionSupplier.get();
wct.removeInsetsSource(mTaskInfo.token, wct.removeInsetsSource(mTaskInfo.token,
mOwner, 0 /* index */, WindowInsets.Type.captionBar()); mOwner, 0 /* index */, WindowInsets.Type.captionBar());
wct.removeInsetsSource(mTaskInfo.token,
mOwner, 0 /* index */, WindowInsets.Type.mandatorySystemGestures());
mTaskOrganizer.applyTransaction(wct); mTaskOrganizer.applyTransaction(wct);
} }

View File

@@ -316,7 +316,8 @@ public class WindowDecorationTests extends ShellTestCase {
releaseOrder.verify(t).remove(captionContainerSurface); releaseOrder.verify(t).remove(captionContainerSurface);
releaseOrder.verify(t).remove(decorContainerSurface); releaseOrder.verify(t).remove(decorContainerSurface);
releaseOrder.verify(t).apply(); releaseOrder.verify(t).apply();
verify(mMockWindowContainerTransaction) // Expect to remove two insets sources, the caption insets and the mandatory gesture insets.
verify(mMockWindowContainerTransaction, Mockito.times(2))
.removeInsetsSource(eq(taskInfo.token), any(), anyInt(), anyInt()); .removeInsetsSource(eq(taskInfo.token), any(), anyInt(), anyInt());
} }