summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/CanvasContext.cpp
diff options
context:
space:
mode:
authorTiger Huang <tigerhuang@google.com>2021-06-24 13:40:22 +0800
committerTiger Huang <tigerhuang@google.com>2021-06-24 09:42:32 +0000
commitc7746aa3deb9deffcab5a50b80ffec4a08740982 (patch)
treee07ead0074e411f3f4847001fcc10256817bcd92 /libs/hwui/renderthread/CanvasContext.cpp
parent9515d87dbbdf530abfac876f0547fee27b188d0e (diff)
Release leashes of insets controls if they are not needed
Previously, leashes would be only released by GC in some cases, but the timing could be late. This CL proactively release them as long as they are not needed. The cases were: 1. The leashes in DisplayImeController. It didn't release leashes while receiving a new one. 2. The leashes returned from addWindow/relayoutWindow. The leashes would be copied to prevent others from releasing them before writeToParcel. The copied leashes could be redundant after writeToParcel. 3. The leashes held by the client whose window is removed. If a window is removed, the server won't invoke mClient.insetsControlChanged, so the client would never get notified about losing control to release the leashes. This could happen if the window doesn't have an exiting animation. Fix: 175851610 Test: Steps in the bug. Test: Show and dismiss a dialog which doesn't have FLAG_ALT_FOCUSABLE_IM or any window animation. Repeat this thousands of times. And see if there are many insets leashes as offscreen layers in `dumpsys SurfaceFlinger` Change-Id: I5eb774ac071154a8d7205dbd1ab4a5f8eca215c3
Diffstat (limited to 'libs/hwui/renderthread/CanvasContext.cpp')
0 files changed, 0 insertions, 0 deletions