use of org.fdroid.fdroid.data.AppPrefs in project fdroidclient by f-droid.
the class KnownVulnAppListItemController method ignoreVulnerableApp.
private void ignoreVulnerableApp(@NonNull App app) {
AppPrefs prefs = app.getPrefs(activity);
prefs.ignoreVulnerabilities = true;
AppPrefsProvider.Helper.update(activity, app, prefs);
refreshUpdatesList();
}
use of org.fdroid.fdroid.data.AppPrefs in project fdroidclient by f-droid.
the class UpdateableAppListItemController method onDismissApp.
@Override
@NonNull
protected DismissResult onDismissApp(@NonNull App app) {
AppPrefs prefs = app.getPrefs(activity);
prefs.ignoreThisUpdate = app.suggestedVersionCode;
// The act of updating here will trigger a re-query of the "can update" apps, so no need to do anything else
// to update the UI in response to this.
AppPrefsProvider.Helper.update(activity, app, prefs);
return new DismissResult(activity.getString(R.string.app_list__dismiss_app_update), false);
}
use of org.fdroid.fdroid.data.AppPrefs in project fdroidclient by f-droid.
the class KnownVulnAppListItemController method setIgnoreVulnerableApp.
private void setIgnoreVulnerableApp(@NonNull App app, boolean ignore) {
AppPrefs prefs = app.getPrefs(activity);
prefs.ignoreVulnerabilities = ignore;
AppPrefsProvider.Helper.update(activity, app, prefs);
refreshUpdatesList();
}
use of org.fdroid.fdroid.data.AppPrefs in project fdroidclient by f-droid.
the class UpdateableAppListItemController method onDismissApp.
@Override
protected void onDismissApp(@NonNull final App app, UpdatesAdapter adapter) {
final AppPrefs prefs = app.getPrefs(activity);
prefs.ignoreThisUpdate = app.autoInstallVersionCode;
Snackbar.make(itemView, R.string.app_list__dismiss_app_update, Snackbar.LENGTH_LONG).setAction(R.string.undo, new View.OnClickListener() {
@Override
public void onClick(View view) {
prefs.ignoreThisUpdate = 0;
AppPrefsProvider.Helper.update(activity, app, prefs);
}
}).show();
// The act of updating here will trigger a re-query of the "can update" apps, so no need to do anything else
// to update the UI in response to this.
AppPrefsProvider.Helper.update(activity, app, prefs);
}
use of org.fdroid.fdroid.data.AppPrefs in project fdroidclient by f-droid.
the class AntiFeaturesTest method allVulnerableButIgnored.
@Test
public void allVulnerableButIgnored() {
install(allVuln, 101);
List<App> installed = AppProvider.Helper.findInstalledAppsWithKnownVulns(context);
assertEquals(1, installed.size());
App app = installed.get(0);
AppPrefs prefs = app.getPrefs(context);
prefs.ignoreVulnerabilities = true;
AppPrefsProvider.Helper.update(context, app, prefs);
List<App> installedButIgnored = AppProvider.Helper.findInstalledAppsWithKnownVulns(context);
assertEquals(0, installedButIgnored.size());
}
Aggregations