OSDN Git Service

Trim graphics memory when closing the shade
authorJorim Jaggi <jjaggi@google.com>
Thu, 25 Sep 2014 00:41:29 +0000 (02:41 +0200)
committerJorim Jaggi <jjaggi@google.com>
Wed, 8 Oct 2014 18:30:54 +0000 (18:30 +0000)
commit786afcb3eec18315ec54987a08814ff28f13d09f
tree17a0b148ab9591401c091414d78d6bfd1fdfd14a
parentb7af00f2b14e9f8333e3518aa81a15502858ea11
Trim graphics memory when closing the shade

Graphics memory usually gets trimmed in applications when the
activity goes into the background. We use quite a lot of graphics
memory when the shade/lockscreen is open, and some of them never gets
freed unless the recents activity is closed, because we don't have
these activity-trimming-heuristics for the shade. This change
proactively trims the graphics memory when the shade gets closed or
when the lockscreen is hidden, to emulate the same heuristics as for
activities.

This change also adds trimMemory on RenderThread to systrace to
verify that no jank is introduced with this change.

This change immediately saves around 10-30 MB on an xxhdpi device
after the shade is closed.

Bug: 17581375
Change-Id: I4fb622efb51815fe08187be97ba15d012d4de5d4
libs/hwui/renderthread/CanvasContext.cpp
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java