Provide gesture and tappable element insets for caption

Caption is covering the app region and will take gesture and tap events
when the user interact with the caption. This change will make sure the
app can receive the caption as a part of the tappable element insets and
gesture insets to avoid the caption overlaps with interactive elements
inside the window.

Bug: 219987804
Bug: 209717743
Test: atest, see the bugs

Change-Id: I6e48f8df6eb8f73a2f62f34109f4d80d09021929
This commit is contained in:
Yunfan Chen
2022-03-31 17:04:21 +09:00
parent a6f4bbd418
commit 16e58e7322

View File

@@ -391,6 +391,17 @@ public class InsetsState implements Parcelable {
processSourceAsPublicType(source, typeInsetsMap, typeSideMap, typeVisibilityMap,
insets, Type.SYSTEM_GESTURES);
}
if (type == Type.CAPTION_BAR) {
// Caption should also be gesture and tappable elements. This should not be needed when
// the caption is added from the shell, as the shell can add other types at the same
// time.
processSourceAsPublicType(source, typeInsetsMap, typeSideMap, typeVisibilityMap,
insets, Type.SYSTEM_GESTURES);
processSourceAsPublicType(source, typeInsetsMap, typeSideMap, typeVisibilityMap,
insets, Type.MANDATORY_SYSTEM_GESTURES);
processSourceAsPublicType(source, typeInsetsMap, typeSideMap, typeVisibilityMap,
insets, Type.TAPPABLE_ELEMENT);
}
}
private void processSourceAsPublicType(InsetsSource source, Insets[] typeInsetsMap,