diff options
| author | 2022-04-27 14:05:48 +0000 | |
|---|---|---|
| committer | 2022-04-27 14:05:48 +0000 | |
| commit | 97ac38dee9da8d83dea7417a62ca46ddb85ecd50 (patch) | |
| tree | 1788106d40431b9fdd1ea1c77fdbba012662f0cc | |
| parent | 8e96c8fc23c246d409a4423bd77469b3c4b731aa (diff) | |
| parent | 926db2d6d37b49b0d31fae3de44476a6c2ce3f9c (diff) | |
Merge "Fix "always" option in ResolverActivity" into tm-dev am: 926db2d6d3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17943621
Change-Id: Ia163106c959e090d82702f4abe70fe51e14a104c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | core/java/com/android/internal/app/ResolverListAdapter.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/core/java/com/android/internal/app/ResolverListAdapter.java b/core/java/com/android/internal/app/ResolverListAdapter.java index 351ac4587def..0a07e0a04a40 100644 --- a/core/java/com/android/internal/app/ResolverListAdapter.java +++ b/core/java/com/android/internal/app/ResolverListAdapter.java @@ -233,8 +233,14 @@ public class ResolverListAdapter extends BaseAdapter { // copied the original unfiltered items to a separate List instance and can now filter // the remainder in-place without any further bookkeeping. boolean needsCopyOfUnfiltered = (mUnfilteredResolveList == currentResolveList); - mUnfilteredResolveList = performSecondaryResolveListFiltering( + List<ResolvedComponentInfo> originalList = performSecondaryResolveListFiltering( currentResolveList, needsCopyOfUnfiltered); + if (originalList != null) { + // Only need the originalList value if there was a modification (otherwise it's null + // and shouldn't overwrite mUnfilteredResolveList). + mUnfilteredResolveList = originalList; + } + return finishRebuildingListWithFilteredResults(currentResolveList, doPostProcessing); } @@ -293,7 +299,7 @@ public class ResolverListAdapter extends BaseAdapter { * appearing in the rebuilt-list results, while still considering those items for the "other * profile" special-treatment described in {@code rebuildList()}. * - * @return the same (possibly null) List reference as {@code currentResolveList}, if the list is + * @return the same (possibly null) List reference as {@code currentResolveList} if the list is * unmodified as a result of filtering; or, if some item(s) were removed, then either a copy of * the original {@code currentResolveList} (if {@code returnCopyOfOriginalListIfModified} is * true), or null (otherwise). |