Merge "Fix IME layering target above IME surface" into sc-v2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
175672ccef
@@ -5009,8 +5009,11 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
|
|||||||
// exists so it get's layered above the starting window.
|
// exists so it get's layered above the starting window.
|
||||||
if (imeTarget != null && !(imeTarget.mActivityRecord != null
|
if (imeTarget != null && !(imeTarget.mActivityRecord != null
|
||||||
&& imeTarget.mActivityRecord.hasStartingWindow())) {
|
&& imeTarget.mActivityRecord.hasStartingWindow())) {
|
||||||
|
final WindowToken imeControlTargetToken =
|
||||||
|
mImeControlTarget != null && mImeControlTarget.getWindow() != null
|
||||||
|
? mImeControlTarget.getWindow().mToken : null;
|
||||||
final boolean canImeTargetSetRelativeLayer = imeTarget.getSurfaceControl() != null
|
final boolean canImeTargetSetRelativeLayer = imeTarget.getSurfaceControl() != null
|
||||||
&& imeTarget == mImeControlTarget
|
&& imeTarget.mToken == imeControlTargetToken
|
||||||
&& !imeTarget.inMultiWindowMode()
|
&& !imeTarget.inMultiWindowMode()
|
||||||
&& imeTarget.mToken.getActivity(app -> app.isAnimating(TRANSITION | PARENTS,
|
&& imeTarget.mToken.getActivity(app -> app.isAnimating(TRANSITION | PARENTS,
|
||||||
ANIMATION_TYPE_ALL & ~ANIMATION_TYPE_RECENTS)) == null;
|
ANIMATION_TYPE_ALL & ~ANIMATION_TYPE_RECENTS)) == null;
|
||||||
|
|||||||
@@ -428,6 +428,25 @@ public class ZOrderingTests extends WindowTestsBase {
|
|||||||
assertWindowHigher(mImeWindow, imeAppTarget);
|
assertWindowHigher(mImeWindow, imeAppTarget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAssignWindowLayers_ForImeOnPopupImeLayeringTarget() {
|
||||||
|
final WindowState imeAppTarget = createWindow(null, TYPE_APPLICATION,
|
||||||
|
mAppWindow.mActivityRecord, "imeAppTarget");
|
||||||
|
mDisplayContent.setImeInputTarget(imeAppTarget);
|
||||||
|
mDisplayContent.setImeLayeringTarget(imeAppTarget);
|
||||||
|
mDisplayContent.setImeControlTarget(imeAppTarget);
|
||||||
|
|
||||||
|
// Set a popup IME layering target and keeps the original IME control target behinds it.
|
||||||
|
final WindowState popupImeTargetWin = createWindow(imeAppTarget,
|
||||||
|
TYPE_APPLICATION_SUB_PANEL, mAppWindow.mActivityRecord, "popupImeTargetWin");
|
||||||
|
mDisplayContent.setImeLayeringTarget(popupImeTargetWin);
|
||||||
|
mDisplayContent.updateImeParent();
|
||||||
|
|
||||||
|
// Ime should on top of the popup IME layering target window.
|
||||||
|
mDisplayContent.assignChildLayers(mTransaction);
|
||||||
|
assertWindowHigher(mImeWindow, popupImeTargetWin);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAssignWindowLayers_ForNegativelyZOrderedSubtype() {
|
public void testAssignWindowLayers_ForNegativelyZOrderedSubtype() {
|
||||||
|
|||||||
Reference in New Issue
Block a user