OSDN Git Service

DO NOT MERGE Fix CtsActivityManagerDeviceTestCases fails
authorChuwei Xu <xucw@motorola.com>
Fri, 22 Mar 2019 06:55:55 +0000 (14:55 +0800)
committerHung-ying Tyan <tyanh@google.com>
Fri, 22 Mar 2019 17:43:08 +0000 (17:43 +0000)
commitb9932b66e6933a316ce2d9636170171ac9eef7ab
tree63dd82b8bf286b8e1f25ff23768110ebf39dce86
parent507d69d5d98d017d9274081fbace2237dd525fc3
DO NOT MERGE Fix CtsActivityManagerDeviceTestCases fails

Avoid 'Failed to create EGLSurface for window 0x951b6808, eglErr = EGL_BAD_ALLOC'.
testStackFocusSwitchOnDisplayRemoved, testStackFocusSwitchOnDisplayRemoved2,
testStackFocusSwitchOnDisplayRemoved3 can have the same problem.

When these testcases release the VirtualDisplay, it will trigger
onParentSet() in TaskStackContainers.At that time mBoostedAppAnimationLayer
may be used for animating, and ResizeableActivity is in it. So
mBoostedAppAnimationLayer.destroy() can also destroy the surface of
ResizeableActivity, but at the same time config changed will make
mAttachInfo.mThreadedRenderer.updateSurface(mSurface) of performTraversals()
in ViewRootImpl to update the surface and cause crash like
'Failed to create EGLSurface for window 0x951b6808,eglErr = EGL_BAD_ALLOC'.
So change to use transaction to call destroy() for mBoostedAppAnimationLayer
to delay it, then ResizeableActivity is not in mBoostedAppAnimationLayer
and can test pass.

Bug: 127896059
Test:  run cts-on-gsi -m CtsActivityManagerDeviceTestCases
-t android.server.am.ActivityManagerMultiDisplayTests

Change-Id: I44ee86d1620f9c2953c574146ec6f529ce6f4656
services/core/java/com/android/server/wm/DisplayContent.java