diff options
| author | Tarandeep Singh <tarandeep@google.com> | 2020-02-03 14:55:30 -0800 |
|---|---|---|
| committer | Taran Singh <tarandeep@google.com> | 2020-02-26 18:58:33 +0000 |
| commit | 94c9a8328e4dc9f8942ffc0d02784700ee77880b (patch) | |
| tree | 2e7d5daf28d3c55cb88f28f5e699ccc74994c499 /core/java/android/view/InsetsSourceConsumer.java | |
| parent | d506a78e94594be701b2a061cb48b5e2f5cf3908 (diff) | |
Remove IME surface when hidden
When IME is no longer shown, notify IMS to hide the window surface.
This reclaims the memory allocated to IME window surface.
Fix: 150163310
Test: atest CtsInputMethodTests
Manually:
1. Open any app that has editor and run
adb shell dumpsys SurfaceFlinger | grep Total
2. Note down total memory
3. Tap on editor and IME shows. Note down memory
using command in #1. It should go up by ~27MB
4. Hide IME and note down memory again.
It should revert to original value in #1.
Change-Id: I6c2a13dd40b22d3fd62b4763ba369992e5ff1138
Diffstat (limited to 'core/java/android/view/InsetsSourceConsumer.java')
| -rw-r--r-- | core/java/android/view/InsetsSourceConsumer.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/core/java/android/view/InsetsSourceConsumer.java b/core/java/android/view/InsetsSourceConsumer.java index e6497c00c8dd..e3a7de126df3 100644 --- a/core/java/android/view/InsetsSourceConsumer.java +++ b/core/java/android/view/InsetsSourceConsumer.java @@ -16,12 +16,10 @@ package android.view; -import static android.view.InsetsController.ANIMATION_TYPE_NONE; import static android.view.InsetsState.toPublicType; import android.annotation.IntDef; import android.annotation.Nullable; -import android.util.MutableShort; import android.view.InsetsState.InternalInsetsType; import android.view.SurfaceControl.Transaction; import android.view.WindowInsets.Type.InsetsType; @@ -137,6 +135,10 @@ public class InsetsSourceConsumer { setRequestedVisible(false); } + void hide(boolean animationFinished) { + hide(); + } + /** * Called when current window gains focus */ @@ -201,6 +203,13 @@ public class InsetsSourceConsumer { } /** + * Remove surface on which this consumer type is drawn. + */ + public void removeSurface() { + // no-op for types that always return ShowResult#SHOW_IMMEDIATELY. + } + + /** * Sets requested visibility from the client, regardless of whether we are able to control it at * the moment. */ |
