summaryrefslogtreecommitdiff
path: root/core/java/android/view/Surface.java
diff options
context:
space:
mode:
authorLucas Dupin <dupin@google.com>2018-03-27 09:50:19 -0700
committerLucas Dupin <dupin@google.com>2018-03-27 16:30:07 -0700
commit41c25cee06abec189ba60b9b76454867c2d64cfd (patch)
tree814b35c9e008ad756f8f279e314c203a446b56d1 /core/java/android/view/Surface.java
parent788e74a6133b13a5758558ca4e40e7151d4a32af (diff)
Unload wallpaper bitmap and release HwuiContext
To decrease sysui memory usage Test: adb dumpsys meminfo Fixes: 74534423 Change-Id: I3cb4a5927e8d6b20a7aeba3fda253f0ba4cc18f6
Diffstat (limited to 'core/java/android/view/Surface.java')
-rw-r--r--core/java/android/view/Surface.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/java/android/view/Surface.java b/core/java/android/view/Surface.java
index d3b1e5c52596..df81a311bb89 100644
--- a/core/java/android/view/Surface.java
+++ b/core/java/android/view/Surface.java
@@ -250,6 +250,18 @@ public class Surface implements Parcelable {
}
/**
+ * Destroys the HwuiContext without completely
+ * releasing the Surface.
+ * @hide
+ */
+ public void hwuiDestroy() {
+ if (mHwuiContext != null) {
+ mHwuiContext.destroy();
+ mHwuiContext = null;
+ }
+ }
+
+ /**
* Returns true if this object holds a valid surface.
*
* @return True if it holds a physical surface, so lockCanvas() will succeed.