diff options
| author | Ahan Wu <ahanwu@google.com> | 2018-05-08 20:42:24 +0800 |
|---|---|---|
| committer | Ahan Wu <ahanwu@google.com> | 2018-12-04 11:29:31 +0800 |
| commit | de396fa85d4041fdd14bf4e0847406017d1f89db (patch) | |
| tree | 5d23b21f78b9f3ff1d62adba9f8cee156076615b /core/java/android/widget/RemoteViews.java | |
| parent | 09c07c3533b11028b4e7da615156026fa8599b85 (diff) | |
Apply cache and preload mechanism to inline image notifications.
Inline image will consume 3x memory due to no cache implementation.
This patch apply cache mechanism to each ExpandableNotificationRow and
preloads images before inflation task.
Bug: 77956056
Test: runtest systemui, observe memory usage by AndroidProfiler
Change-Id: I2c488b1d98ddf2d4670904ed4b3e8028c0d0172e
Diffstat (limited to 'core/java/android/widget/RemoteViews.java')
| -rw-r--r-- | core/java/android/widget/RemoteViews.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java index 7b39efed0c3a..3c361c348ca7 100644 --- a/core/java/android/widget/RemoteViews.java +++ b/core/java/android/widget/RemoteViews.java @@ -3373,6 +3373,12 @@ public class RemoteViews implements Parcelable, Filter { * @hide */ public interface OnViewAppliedListener { + /** + * Callback when the RemoteView has finished inflating, + * but no actions have been applied yet. + */ + default void onViewInflated(View v) {}; + void onViewApplied(View v); void onError(Exception e); @@ -3469,6 +3475,10 @@ public class RemoteViews implements Parcelable, Filter { @Override protected void onPostExecute(ViewTree viewTree) { if (mError == null) { + if (mListener != null) { + mListener.onViewInflated(viewTree.mRoot); + } + try { if (mActions != null) { OnClickHandler handler = mHandler == null |
