diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp index 91f9447a3d59c..1df3336bb5e5d 100644 --- a/libs/hwui/renderthread/CanvasContext.cpp +++ b/libs/hwui/renderthread/CanvasContext.cpp @@ -204,8 +204,7 @@ void CanvasContext::setStopped(bool stopped) { void CanvasContext::allocateBuffers() { if (mNativeSurface) { - ANativeWindow* anw = mNativeSurface->getNativeWindow(); - ANativeWindow_allocateBuffers(anw); + ANativeWindow_tryAllocateBuffers(mNativeSurface->getNativeWindow()); } }