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

Commit 984886d9 authored by Andrey Yepin's avatar Andrey Yepin
Browse files

ChooserListAdapter: remove notifyDataSetChanged delay.

The current notifyDataSetChange is 0 but still asynchronous.
Make it a regular syncrhonous call to avoid a possible desynchronization
between the ChooserListAdapter and the RecyclerView.

Fix: 406397494
Test: manual test of the app-screen-recording UI
Flag: android.service.chooser.do_not_delay_chooser_adapter_notify_data_change
Change-Id: I1bdb814a5930fac8baad6fd44043eac2d98589e3
parent 9cfc68f8
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -19,6 +19,16 @@ flag {
  bug: "323380224"
}

flag {
  name: "do_not_delay_chooser_adapter_notify_data_change"
  namespace: "intentresolver"
  description: "Do not delay ChooserAdapter notifyDataSetChanged call."
  bug: "406397494"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}

flag {
  name: "enable_sharesheet_metadata_extra"
  is_exported: true
+5 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.internal.app;

import static android.service.chooser.Flags.doNotDelayChooserAdapterNotifyDataChange;
import static android.service.chooser.Flags.notifySingleItemChangeOnIconLoad;

import static com.android.internal.app.ChooserActivity.TARGET_TYPE_SHORTCUTS_FROM_PREDICTION_SERVICE;
@@ -245,6 +246,10 @@ public class ChooserListAdapter extends ResolverListAdapter {

    @Override
    public void notifyDataSetChanged() {
        if (doNotDelayChooserAdapterNotifyDataChange()) {
            super.notifyDataSetChanged();
            return;
        }
        if (!mListViewDataChanged) {
            mChooserListCommunicator.sendListViewUpdateMessage(getUserHandle());
            mListViewDataChanged = true;