Skip to content

Commit

Permalink
Issue #300 system apps setting check
Browse files Browse the repository at this point in the history
  • Loading branch information
yeriomin committed Nov 3, 2017
1 parent c0b839c commit 71019eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ public void addApps(List<App> appsToAdd, boolean update) {

public void removeApp(String packageName) {
((AppListAdapter) getListView().getAdapter()).remove(listItems.get(packageName));
listItems.remove(packageName);
}

public Set<String> getListedPackageNames() {
return listItems.keySet();
}

public void clearApps() {
listItems.clear();
((AppListAdapter) getListView().getAdapter()).clear();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.os.AsyncTask;
import android.util.Log;

import com.github.yeriomin.yalpstore.AppListActivity;
import com.github.yeriomin.yalpstore.BlackWhiteListManager;
Expand Down Expand Up @@ -35,14 +34,12 @@ protected void onPostExecute(Set<String> installedPackageNames) {
Set<String> newPackageNames = new HashSet<>(installedPackageNames);
newPackageNames.removeAll(activity.getListedPackageNames());
if (!respectUpdateBlacklist && newPackageNames.size() > 0) {
Log.i(getClass().getName(), "Rebuilding app list");
activity.loadApps();
return;
}
Set<String> removedPackageNames = new HashSet<>(activity.getListedPackageNames());
removedPackageNames.removeAll(installedPackageNames);
for (String packageName: removedPackageNames) {
Log.i(getClass().getName(), "Removing package from list: " + packageName);
activity.removeApp(packageName);
}
}
Expand Down

0 comments on commit 71019eb

Please sign in to comment.