[app] Fix scope list logic (#178)
This commit is contained in:
parent
6aed74acdd
commit
04cdb6c950
|
|
@ -114,7 +114,11 @@ public class ConfigManager {
|
||||||
if (applications == null) {
|
if (applications == null) {
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
applications.forEach(application -> list.add(new ScopeAdapter.ApplicationWithEquals(application)));
|
applications.forEach(application -> {
|
||||||
|
if (!application.packageName.equals(packageName)) {
|
||||||
|
list.add(new ScopeAdapter.ApplicationWithEquals(application));
|
||||||
|
}
|
||||||
|
});
|
||||||
} catch (RemoteException | NullPointerException e) {
|
} catch (RemoteException | NullPointerException e) {
|
||||||
Log.e(App.TAG, Log.getStackTraceString(e));
|
Log.e(App.TAG, Log.getStackTraceString(e));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,10 @@ public class ScopeAdapter extends RecyclerView.Adapter<ScopeAdapter.ViewHolder>
|
||||||
boolean emptyCheckedList = checkedList.isEmpty();
|
boolean emptyCheckedList = checkedList.isEmpty();
|
||||||
for (PackageInfo info : appList) {
|
for (PackageInfo info : appList) {
|
||||||
int uid = info.applicationInfo.uid;
|
int uid = info.applicationInfo.uid;
|
||||||
|
if (info.packageName.equals("android") && uid / 100000 != 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
ApplicationWithEquals application = new ApplicationWithEquals(info.packageName, uid / 100000);
|
ApplicationWithEquals application = new ApplicationWithEquals(info.packageName, uid / 100000);
|
||||||
|
|
||||||
installedList.add(application);
|
installedList.add(application);
|
||||||
|
|
@ -174,13 +178,9 @@ public class ScopeAdapter extends RecyclerView.Adapter<ScopeAdapter.ViewHolder>
|
||||||
if (info.packageName.equals(this.modulePackageName)) {
|
if (info.packageName.equals(this.modulePackageName)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info.packageName.equals(BuildConfig.APPLICATION_ID)) {
|
if (info.packageName.equals(BuildConfig.APPLICATION_ID)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (info.packageName.equals("android")) {
|
|
||||||
return app.userId != 0;
|
|
||||||
}
|
|
||||||
if (checkedList.contains(app)) {
|
if (checkedList.contains(app)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue