[app] Fix check scope app
This commit is contained in:
parent
f9adf20eeb
commit
83ec9396a5
|
|
@ -134,6 +134,7 @@ public class ScopeAdapter extends RecyclerView.Adapter<ScopeAdapter.ViewHolder>
|
||||||
checkedList.addAll(ConfigManager.getModuleScope(modulePackageName));
|
checkedList.addAll(ConfigManager.getModuleScope(modulePackageName));
|
||||||
ArrayList<Application> installedList = new ArrayList<>();
|
ArrayList<Application> installedList = new ArrayList<>();
|
||||||
List<String> scopeList = ModuleUtil.getInstance().getModule(modulePackageName).getScopeList();
|
List<String> scopeList = ModuleUtil.getInstance().getModule(modulePackageName).getScopeList();
|
||||||
|
boolean emptyCheckedList = checkedList.isEmpty();
|
||||||
for (PackageInfo info : appList) {
|
for (PackageInfo info : appList) {
|
||||||
int uid = info.applicationInfo.uid;
|
int uid = info.applicationInfo.uid;
|
||||||
Application application = new Application();
|
Application application = new Application();
|
||||||
|
|
@ -144,6 +145,9 @@ public class ScopeAdapter extends RecyclerView.Adapter<ScopeAdapter.ViewHolder>
|
||||||
|
|
||||||
if (scopeList != null && scopeList.contains(info.packageName)) {
|
if (scopeList != null && scopeList.contains(info.packageName)) {
|
||||||
recommendedList.add(application);
|
recommendedList.add(application);
|
||||||
|
if (emptyCheckedList) {
|
||||||
|
checkedList.add(application);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shouldHideApp(info, application)) {
|
if (shouldHideApp(info, application)) {
|
||||||
|
|
@ -159,8 +163,8 @@ public class ScopeAdapter extends RecyclerView.Adapter<ScopeAdapter.ViewHolder>
|
||||||
searchList.add(appInfo);
|
searchList.add(appInfo);
|
||||||
}
|
}
|
||||||
checkedList.retainAll(installedList);
|
checkedList.retainAll(installedList);
|
||||||
if (checkedList.isEmpty() && !recommendedList.isEmpty()) {
|
if (emptyCheckedList) {
|
||||||
checkRecommended();
|
ConfigManager.setModuleScope(modulePackageName, checkedList);
|
||||||
}
|
}
|
||||||
showList = sortApps(searchList);
|
showList = sortApps(searchList);
|
||||||
activity.onDataReady();
|
activity.onDataReady();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue