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

Commit 02a118de authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Rebuild list before calling useLayoutWithDefault()."

parents 353f470b bb572333
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -1226,9 +1226,9 @@ public class ChooserActivity extends ResolverActivity implements
    }
    }


    @Override
    @Override
    protected boolean rebuildList() {
    protected boolean postRebuildList(boolean rebuildCompleted) {
        mChooserListAdapter = (ChooserListAdapter) mAdapter;
        mChooserListAdapter = (ChooserListAdapter) mAdapter;
        return rebuildListInternal();
        return postRebuildListInternal(rebuildCompleted);
    }
    }


    @Override
    @Override
+16 −10
Original line number Original line Diff line number Diff line
@@ -328,9 +328,8 @@ public class ResolverActivity extends Activity implements
        boolean filterLastUsed = mSupportsAlwaysUseOption && !isVoiceInteraction();
        boolean filterLastUsed = mSupportsAlwaysUseOption && !isVoiceInteraction();
        mAdapter = createAdapter(this, mIntents, initialIntents, rList,
        mAdapter = createAdapter(this, mIntents, initialIntents, rList,
                filterLastUsed, mUseLayoutForBrowsables);
                filterLastUsed, mUseLayoutForBrowsables);
        configureContentView();


        if (rebuildList()) {
        if (configureContentView()) {
            return;
            return;
        }
        }


@@ -1063,11 +1062,13 @@ public class ResolverActivity extends Activity implements


    /**
    /**
     * Sets up the content view.
     * Sets up the content view.
     * @return <code>true</code> if the activity is finishing and creation should halt.
     */
     */
    private void configureContentView() {
    private boolean configureContentView() {
        if (mAdapter == null) {
        if (mAdapter == null) {
            throw new IllegalStateException("mAdapter cannot be null.");
            throw new IllegalStateException("mAdapter cannot be null.");
        }
        }
        boolean rebuildCompleted = mAdapter.rebuildList();
        if (useLayoutWithDefault()) {
        if (useLayoutWithDefault()) {
            mLayoutId = R.layout.resolver_list_with_default;
            mLayoutId = R.layout.resolver_list_with_default;
        } else {
        } else {
@@ -1075,21 +1076,26 @@ public class ResolverActivity extends Activity implements
        }
        }
        setContentView(mLayoutId);
        setContentView(mLayoutId);
        mAdapterView = findViewById(R.id.resolver_list);
        mAdapterView = findViewById(R.id.resolver_list);
        return postRebuildList(rebuildCompleted);
    }
    }


    /**
    /**
     * Returns true if the activity is finishing and creation should halt.
     * Finishing procedures to be performed after the list has been rebuilt.
     * </p>Subclasses must call rebuildListInternal at the end of rebuildList.
     * </p>Subclasses must call postRebuildListInternal at the end of postRebuildList.
     * @param rebuildCompleted
     * @return <code>true</code> if the activity is finishing and creation should halt.
     */
     */
    protected boolean rebuildList() {
    protected boolean postRebuildList(boolean rebuildCompleted) {
        return rebuildListInternal();
        return postRebuildListInternal(rebuildCompleted);
    }
    }


    /**
    /**
     * Returns true if the activity is finishing and creation should halt.
     * Finishing procedures to be performed after the list has been rebuilt.
     * @param rebuildCompleted
     * @return <code>true</code> if the activity is finishing and creation should halt.
     */
     */
    final boolean rebuildListInternal() {
    final boolean postRebuildListInternal(boolean rebuildCompleted) {
        boolean rebuildCompleted = mAdapter.rebuildList();

        int count = mAdapter.getUnfilteredCount();
        int count = mAdapter.getUnfilteredCount();


        // We only rebuild asynchronously when we have multiple elements to sort. In the case where
        // We only rebuild asynchronously when we have multiple elements to sort. In the case where