Add ability to force rebuild list

So that you can change between filters that
have the same sort order.

Test: robotests, manually switch between notifications (off) to
notifications (all)
Fixes: 169943424

Change-Id: I62bbe90f30abada2ec342487a1fa420e451b3caf
This commit is contained in:
Julia Reynolds
2021-11-05 17:12:00 -04:00
parent bf6c779caa
commit b106377155
2 changed files with 13 additions and 10 deletions

View File

@@ -768,7 +768,7 @@ public class ManageApplications extends InstrumentedFragment
int i = item.getItemId();
if (i == R.id.sort_order_alpha || i == R.id.sort_order_size) {
if (mApplications != null) {
mApplications.rebuild(menuId);
mApplications.rebuild(menuId, false);
}
} else if (i == R.id.show_system || i == R.id.hide_system) {
mShowSystem = !mShowSystem;
@@ -1097,13 +1097,13 @@ public class ManageApplications extends InstrumentedFragment
// Notification filters require resorting the list
if (mManageApplications.mListType == LIST_TYPE_NOTIFICATION) {
if (FILTER_APPS_FREQUENT == appFilter.getFilterType()) {
rebuild(R.id.sort_order_frequent_notification);
rebuild(R.id.sort_order_frequent_notification, false);
} else if (FILTER_APPS_RECENT == appFilter.getFilterType()) {
rebuild(R.id.sort_order_recent_notification);
rebuild(R.id.sort_order_recent_notification, false);
} else if (FILTER_APPS_BLOCKED == appFilter.getFilterType()) {
rebuild(R.id.sort_order_alpha);
rebuild(R.id.sort_order_alpha, true);
} else {
rebuild(R.id.sort_order_alpha);
rebuild(R.id.sort_order_alpha, true);
}
} else {
rebuild();
@@ -1121,7 +1121,7 @@ public class ManageApplications extends InstrumentedFragment
}
rebuild();
} else {
rebuild(sort);
rebuild(sort, false);
}
}
@@ -1149,8 +1149,8 @@ public class ManageApplications extends InstrumentedFragment
}
}
public void rebuild(int sort) {
if (sort == mLastSortMode) {
public void rebuild(int sort, boolean force) {
if (sort == mLastSortMode && !force) {
return;
}
mManageApplications.mSortOrder = sort;