My application does not use GL layout, but the number of problems with libhwui is high.
I found commonality in these bugs.When the app is switching between the foreground and background,The Surface will be recreated
05-19 23:57:07.012 30721 30721 F DEBUG : Build fingerprint: 'Xiaomi/dipper/dipper:9/PKQ1.180729.001/V10.3.2.0.PEACNXM:user/release-keys'
05-19 23:57:07.012 30721 30721 F DEBUG : Revision: '0'
05-19 23:57:07.012 30721 30721 F DEBUG : ABI: 'arm'
05-19 23:57:07.012 30721 30721 F DEBUG : pid: 11899, tid: 12223, name: RenderThread >>> com.sankuai.meituan <<<
05-19 23:57:07.012 30721 30721 F DEBUG : signal 6 (SIGABRT), code 0 (SI_USER), fault addr --------
05-19 23:57:07.012 30721 30721 F DEBUG : Abort message: 'Failed to create EGLSurface for window 0xb670b008, eglErr = EGL_BAD_ALLOC'
05-19 23:57:07.012 30721 30721 F DEBUG : r0 00000000 r1 00002fbf r2 00000006 r3 00000008
05-19 23:57:07.012 30721 30721 F DEBUG : r4 00002e7b r5 00002fbf r6 b82ff414 r7 0000010c
05-19 23:57:07.012 30721 30721 F DEBUG : r8 00000000 r9 ba903450 r10 ba903444 r11 ba903428
05-19 23:57:07.013 30721 30721 F DEBUG : ip b82ff3b0 sp b82ff400 lr e956c139 pc e9563e56
05-19 23:57:07.267 30721 30721 F DEBUG :
05-19 23:57:07.267 30721 30721 F DEBUG : backtrace:
05-19 23:57:07.268 30721 30721 F DEBUG : #00 pc 0001ce56 /system/lib/libc.so (abort+58)
05-19 23:57:07.268 30721 30721 F DEBUG : #01 pc 00006ccd /system/lib/liblog.so (__android_log_assert+156)
05-19 23:57:07.268 30721 30721 F DEBUG : #02 pc 00363215 /system/lib/libhwui.so (android::uirenderer::renderthread::EglManager::createSurface(ANativeWindow*, bool)+212)
05-19 23:57:07.268 30721 30721 F DEBUG : #03 pc 0035f2f7 /system/lib/libhwui.so (android::uirenderer::skiapipeline::SkiaOpenGLPipeline::setSurface(android::Surface*, android::uirenderer::renderthread::SwapBehavior, android::uirenderer::renderthread::ColorMode)+46)
05-19 23:57:07.268 30721 30721 F DEBUG : #04 pc 00361aeb /system/lib/libhwui.so (android::uirenderer::renderthread::CanvasContext::setSurface(android::sp<android::Surface>&&)+62)
05-19 23:57:07.268 30721 30721 F DEBUG : #05 pc 000a18f3 /system/lib/libhwui.so (_ZNSt3__110__function6__funcIZN7android10uirenderer12renderthread11RenderProxy10initializeERKNS2_2spINS2_7SurfaceEEEE3$_6NS_9allocatorISB_EEFvvEEclEv$64c930c5b4139b4fd99ae4f62fbd45a8+12)
05-19 23:57:07.268 30721 30721 F DEBUG : #06 pc 0032b2ff /system/lib/libhwui.so (android::uirenderer::WorkQueue::process()+122)
05-19 23:57:07.268 30721 30721 F DEBUG : #07 pc 000a3243 /system/lib/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+178)
05-19 23:57:07.268 30721 30721 F DEBUG : #08 pc 0000c113 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+166)
05-19 23:57:07.268 30721 30721 F DEBUG : #09 pc 000637f5 /system/lib/libc.so (__pthread_start(void*)+22)
05-19 23:57:07.268 30721 30721 F DEBUG : #10 pc 0001e019 /system/lib/libc.so (__start_thread+24)