diff options
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java | 3 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java | 13 |
2 files changed, 16 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java index 76970610bc75..ba3bcc79da44 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java @@ -514,6 +514,9 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD RecentsActivityLaunchState launchState = config.getLaunchState(); launchState.reset(); } + + // Force a gc to attempt to clean up bitmap references more quickly (b/38258699) + Recents.getSystemServices().gc(); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java index cbfa0e58add1..1f13830ec1cc 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +++ b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java @@ -362,6 +362,19 @@ public class SystemServicesProxy { } /** + * Requests a gc() from the background thread. + */ + public void gc() { + BackgroundThread.getHandler().post(new Runnable() { + @Override + public void run() { + System.gc(); + System.runFinalization(); + } + }); + } + + /** * @return whether the provided {@param className} is blacklisted */ public boolean isBlackListedActivity(String className) { |