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

Commit e6b4d591 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8060779 from 175672cc to sc-v2-release

Change-Id: I9a898e41d1fce62a7e0781c12c4d8267032a4600
parents d03d1e62 175672cc
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -4178,15 +4178,20 @@ public final class ActivityThread extends ClientTransactionHandler
        view.requestLayout();

        view.getViewTreeObserver().addOnDrawListener(new ViewTreeObserver.OnDrawListener() {
            private boolean mHandled = false;
            @Override
            public void onDraw() {
                if (mHandled) {
                    return;
                }
                mHandled = true;
                // Transfer the splash screen view from shell to client.
                // Call syncTransferSplashscreenViewTransaction at the first onDraw so we can ensure
                // the client view is ready to show and we can use applyTransactionOnDraw to make
                // all transitions happen at the same frame.
                syncTransferSplashscreenViewTransaction(
                        view, r.token, decorView, startingWindowLeash);
                view.postOnAnimation(() -> view.getViewTreeObserver().removeOnDrawListener(this));
                view.post(() -> view.getViewTreeObserver().removeOnDrawListener(this));
            }
        });
    }
+6 −3
Original line number Diff line number Diff line
@@ -4165,10 +4165,10 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
        final SurfaceControl newParent = computeImeParent();
        if (newParent != null && newParent != mInputMethodSurfaceParent) {
            mInputMethodSurfaceParent = newParent;
            getPendingTransaction().reparent(mImeWindowsContainer.mSurfaceControl, newParent);
            getSyncTransaction().reparent(mImeWindowsContainer.mSurfaceControl, newParent);
            // When surface parent is removed, the relative layer will also be removed. We need to
            // do a force update to make sure there is a layer set for the new parent.
            assignRelativeLayerForIme(getPendingTransaction(), true /* forceUpdate */);
            assignRelativeLayerForIme(getSyncTransaction(), true /* forceUpdate */);
            scheduleAnimation();
        }
    }
@@ -5009,8 +5009,11 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
        // exists so it get's layered above the starting window.
        if (imeTarget != null && !(imeTarget.mActivityRecord != null
                && imeTarget.mActivityRecord.hasStartingWindow())) {
            final WindowToken imeControlTargetToken =
                    mImeControlTarget != null && mImeControlTarget.getWindow() != null
                            ? mImeControlTarget.getWindow().mToken : null;
            final boolean canImeTargetSetRelativeLayer = imeTarget.getSurfaceControl() != null
                    && imeTarget == mImeControlTarget
                    && imeTarget.mToken == imeControlTargetToken
                    && !imeTarget.inMultiWindowMode()
                    && imeTarget.mToken.getActivity(app -> app.isAnimating(TRANSITION | PARENTS,
                            ANIMATION_TYPE_ALL & ~ANIMATION_TYPE_RECENTS)) == null;
+19 −0
Original line number Diff line number Diff line
@@ -428,6 +428,25 @@ public class ZOrderingTests extends WindowTestsBase {
        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
    public void testAssignWindowLayers_ForNegativelyZOrderedSubtype() {