Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 944abc5a authored by Sihua Ma's avatar Sihua Ma
Browse files

Set only one remote adapter for RemoteViews

Previously, it is possible to have two different kinds of adapters in
the RemoteViews from partial updates. This could cause some unexpected
behaviors and performance issues. This change overwrites previous remote
adapters when there is a partial update to the RemoteViews.

Test: Presubmit
Bug: 245950570
Change-Id: I3761f52fbe77db2efa302225086314587565fdf9
parent 9c828ecc
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -232,6 +232,7 @@ public class RemoteViews implements Parcelable, Filter {
    private static final int NIGHT_MODE_REFLECTION_ACTION_TAG = 30;
    private static final int SET_REMOTE_COLLECTION_ITEMS_ADAPTER_TAG = 31;
    private static final int ATTRIBUTE_REFLECTION_ACTION_TAG = 32;
    private static final int SET_REMOTE_ADAPTER_TAG = 33;

    /** @hide **/
    @IntDef(prefix = "MARGIN_", value = {
@@ -955,6 +956,11 @@ public class RemoteViews implements Parcelable, Filter {
            return SET_REMOTE_VIEW_ADAPTER_LIST_TAG;
        }

        @Override
        public String getUniqueKey() {
            return (SET_REMOTE_ADAPTER_TAG + "_" + viewId);
        }

        int viewTypeCount;
        ArrayList<RemoteViews> list;
    }
@@ -1077,6 +1083,11 @@ public class RemoteViews implements Parcelable, Filter {
        public int getActionTag() {
            return SET_REMOTE_COLLECTION_ITEMS_ADAPTER_TAG;
        }

        @Override
        public String getUniqueKey() {
            return (SET_REMOTE_ADAPTER_TAG + "_" + viewId);
        }
    }

    private class SetRemoteViewsAdapterIntent extends Action {