Fix no apps shown on app info screen

If Settings app hasn't loaded apps list completely yet,
we can't filter result from list. Since there is nothing
can be filtered, we just need to show all apps.

Test: visual
Fixes: 131697606
Change-Id: I971c942b0fe5889206c40d855f8508acd42461a7
This commit is contained in:
tmfang
2019-05-23 17:49:44 +08:00
parent 27d09aeb0c
commit 71dea4743e

View File

@@ -1169,10 +1169,16 @@ public class ManageApplications extends InstrumentedFragment
}); });
} }
public void filterSearch(String query) { @VisibleForTesting
void filterSearch(String query) {
if (mSearchFilter == null) { if (mSearchFilter == null) {
mSearchFilter = new SearchFilter(); mSearchFilter = new SearchFilter();
} }
// If we haven't load apps list completely, don't filter anything.
if(mOriginalEntries == null) {
Log.w(TAG, "Apps haven't loaded completely yet, so nothing can be filtered");
return;
}
mSearchFilter.filter(query); mSearchFilter.filter(query);
} }