diff options
| -rw-r--r-- | core/java/com/android/internal/app/ChooserActivity.java | 4 | ||||
| -rw-r--r-- | core/java/com/android/internal/app/ResolverActivity.java | 26 |
2 files changed, 18 insertions, 12 deletions
diff --git a/core/java/com/android/internal/app/ChooserActivity.java b/core/java/com/android/internal/app/ChooserActivity.java index b1752a47ea93..9fbd48ef302d 100644 --- a/core/java/com/android/internal/app/ChooserActivity.java +++ b/core/java/com/android/internal/app/ChooserActivity.java @@ -1226,9 +1226,9 @@ public class ChooserActivity extends ResolverActivity implements } @Override - protected boolean rebuildList() { + protected boolean postRebuildList(boolean rebuildCompleted) { mChooserListAdapter = (ChooserListAdapter) mAdapter; - return rebuildListInternal(); + return postRebuildListInternal(rebuildCompleted); } @Override diff --git a/core/java/com/android/internal/app/ResolverActivity.java b/core/java/com/android/internal/app/ResolverActivity.java index c1c6ac9dfa89..c48ce140e549 100644 --- a/core/java/com/android/internal/app/ResolverActivity.java +++ b/core/java/com/android/internal/app/ResolverActivity.java @@ -325,9 +325,8 @@ public class ResolverActivity extends Activity implements boolean filterLastUsed = mSupportsAlwaysUseOption && !isVoiceInteraction(); mAdapter = createAdapter(this, mIntents, initialIntents, rList, filterLastUsed, mUseLayoutForBrowsables); - configureContentView(); - if (rebuildList()) { + if (configureContentView()) { return; } @@ -1054,11 +1053,13 @@ public class ResolverActivity extends Activity implements /** * 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) { throw new IllegalStateException("mAdapter cannot be null."); } + boolean rebuildCompleted = mAdapter.rebuildList(); if (useLayoutWithDefault()) { mLayoutId = R.layout.resolver_list_with_default; } else { @@ -1066,21 +1067,26 @@ public class ResolverActivity extends Activity implements } setContentView(mLayoutId); mAdapterView = findViewById(R.id.resolver_list); + return postRebuildList(rebuildCompleted); } /** - * Returns true if the activity is finishing and creation should halt. - * </p>Subclasses must call rebuildListInternal at the end of rebuildList. + * Finishing procedures to be performed after the list has been rebuilt. + * </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() { - return rebuildListInternal(); + protected boolean postRebuildList(boolean rebuildCompleted) { + 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() { - boolean rebuildCompleted = mAdapter.rebuildList(); + final boolean postRebuildListInternal(boolean rebuildCompleted) { + int count = mAdapter.getUnfilteredCount(); // We only rebuild asynchronously when we have multiple elements to sort. In the case where |