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

Commit 19a4ed73 authored by Andrey Yepin's avatar Andrey Yepin Committed by Android (Google) Code Review
Browse files

Merge "Remove released do_not_delay_chooser_adapter_notify_data_change flag." into main

parents bae83ef0 0b66ba3e
Loading
Loading
Loading
Loading
+0 −10
Original line number Original line Diff line number Diff line
@@ -9,16 +9,6 @@ flag {
  bug: "323380224"
  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 {
flag {
  name: "enable_sharesheet_metadata_extra"
  name: "enable_sharesheet_metadata_extra"
  is_exported: true
  is_exported: true
+0 −20
Original line number Original line Diff line number Diff line
@@ -493,11 +493,9 @@ public class ChooserActivity extends ResolverActivity implements
    private final ChooserHandler mChooserHandler = new ChooserHandler();
    private final ChooserHandler mChooserHandler = new ChooserHandler();


    private class ChooserHandler extends Handler {
    private class ChooserHandler extends Handler {
        private static final int LIST_VIEW_UPDATE_MESSAGE = 6;
        private static final int SHORTCUT_MANAGER_ALL_SHARE_TARGET_RESULTS = 7;
        private static final int SHORTCUT_MANAGER_ALL_SHARE_TARGET_RESULTS = 7;


        private void removeAllMessages() {
        private void removeAllMessages() {
            removeMessages(LIST_VIEW_UPDATE_MESSAGE);
            removeMessages(SHORTCUT_MANAGER_ALL_SHARE_TARGET_RESULTS);
            removeMessages(SHORTCUT_MANAGER_ALL_SHARE_TARGET_RESULTS);
        }
        }


@@ -508,16 +506,6 @@ public class ChooserActivity extends ResolverActivity implements
            }
            }


            switch (msg.what) {
            switch (msg.what) {
                case LIST_VIEW_UPDATE_MESSAGE:
                    if (DEBUG) {
                        Log.d(TAG, "LIST_VIEW_UPDATE_MESSAGE; ");
                    }

                    UserHandle userHandle = (UserHandle) msg.obj;
                    mChooserMultiProfilePagerAdapter.getListAdapterForUserHandle(userHandle)
                            .refreshListView();
                    break;

                case SHORTCUT_MANAGER_ALL_SHARE_TARGET_RESULTS:
                case SHORTCUT_MANAGER_ALL_SHARE_TARGET_RESULTS:
                    if (DEBUG) Log.d(TAG, "SHORTCUT_MANAGER_ALL_SHARE_TARGET_RESULTS");
                    if (DEBUG) Log.d(TAG, "SHORTCUT_MANAGER_ALL_SHARE_TARGET_RESULTS");
                    final ServiceResultInfo[] resultInfos = (ServiceResultInfo[]) msg.obj;
                    final ServiceResultInfo[] resultInfos = (ServiceResultInfo[]) msg.obj;
@@ -2831,14 +2819,6 @@ public class ChooserActivity extends ResolverActivity implements
        return mMaxTargetsPerRow;
        return mMaxTargetsPerRow;
    }
    }


    @Override // ChooserListCommunicator
    public void sendListViewUpdateMessage(UserHandle userHandle) {
        Message msg = Message.obtain();
        msg.what = ChooserHandler.LIST_VIEW_UPDATE_MESSAGE;
        msg.obj = userHandle;
        mChooserHandler.sendMessageDelayed(msg, mListViewUpdateDelayMs);
    }

    @Override
    @Override
    public void onListRebuilt(ResolverListAdapter listAdapter, boolean rebuildComplete) {
    public void onListRebuilt(ResolverListAdapter listAdapter, boolean rebuildComplete) {
        setupScrollListener();
        setupScrollListener();
+0 −23
Original line number Original line Diff line number Diff line
@@ -16,7 +16,6 @@


package com.android.internal.app;
package com.android.internal.app;


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


import static com.android.internal.app.ChooserActivity.TARGET_TYPE_SHORTCUTS_FROM_PREDICTION_SERVICE;
import static com.android.internal.app.ChooserActivity.TARGET_TYPE_SHORTCUTS_FROM_PREDICTION_SERVICE;
@@ -102,7 +101,6 @@ public class ChooserListAdapter extends ResolverListAdapter {


    private final ChooserActivity.BaseChooserTargetComparator mBaseTargetComparator =
    private final ChooserActivity.BaseChooserTargetComparator mBaseTargetComparator =
            new ChooserActivity.BaseChooserTargetComparator();
            new ChooserActivity.BaseChooserTargetComparator();
    private boolean mListViewDataChanged = false;


    // Sorted list of DisplayResolveInfos for the alphabetical app section.
    // Sorted list of DisplayResolveInfos for the alphabetical app section.
    private List<DisplayResolveInfo> mSortedList = new ArrayList<>();
    private List<DisplayResolveInfo> mSortedList = new ArrayList<>();
@@ -244,25 +242,6 @@ public class ChooserListAdapter extends ResolverListAdapter {


    }
    }


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

    void refreshListView() {
        if (mListViewDataChanged) {
            super.notifyDataSetChanged();
        }
        mListViewDataChanged = false;
    }

    private void createPlaceHolders() {
    private void createPlaceHolders() {
        mNumShortcutResults = 0;
        mNumShortcutResults = 0;
        mServiceTargets.clear();
        mServiceTargets.clear();
@@ -797,8 +776,6 @@ public class ChooserListAdapter extends ResolverListAdapter {


        int getMaxRankedTargets();
        int getMaxRankedTargets();


        void sendListViewUpdateMessage(UserHandle userHandle);

        boolean isSendAction(Intent targetIntent);
        boolean isSendAction(Intent targetIntent);


        boolean shouldShowContentPreview();
        boolean shouldShowContentPreview();