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

Commit 4ffa367e authored by Melody Hsu's avatar Melody Hsu
Browse files

Add null screenshot buffer check to IME Z-order test

A race condition would occur when a new layer was created, but not
yet added by LayerLifecycleManager. Screenshot functions would
attempt to access the created, but unadded layer, resulting an IME
Z-ordering test to create a null buffer in the place of the screenshot
result. Update the test to catch future instances of screenshot errors
before any z-order assertions are made.

Fixes: b/424648199
Test: atest ZOrderingTests#testImeScreenshotLayer
Flag: EXEMPT, bug fix
Change-Id: I50d56416f2eb833c6119fb16112ef135d63a7611
parent e6200b15
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -538,6 +538,7 @@ public class ZOrderingTests extends WindowTestsBase {

        assertEquals(imeAppTarget, mDisplayContent.mImeScreenshot.getImeTarget());
        assertNotNull(mDisplayContent.mImeScreenshot);
        assertNotNull(imeBuffer);
        assertZOrderGreaterThan(mTransaction, mDisplayContent.mImeScreenshot.getSurface(),
                imeAppTarget.mSurfaceControl);
    }