AppProvider extends FDroidProvider { public static Uri getContentUri() { return Uri.parse("content: }  static Uri getContentUri(); static Uri getRecentlyUpdatedUri(); static Uri getCategoryUri(String category); static Uri getInstalledWithKnownVulnsUri(); static Uri getTopFromCategoryUri(String category, int limit); static Uri getInstalledUri(); static Uri getCanUpdateUri(); static Uri getRepoUri(Repo repo); static Uri getSpecificAppUri(String packageName, long repoId); static Uri getHighestPriorityMetadataUri(String packageName); static Uri getSearchUri(String query, @Nullable String category); static Uri getSearchUri(Repo repo, String query); static String getAuthority(); @Override Cursor query(@NonNull Uri uri, String[] projection, String customSelection, String[] selectionArgs, String sortOrder); @Override int delete(@NonNull Uri uri, String where, String[] whereArgs); @Override Uri insert(@NonNull Uri uri, ContentValues values); @Override int update(@NonNull Uri uri, ContentValues values, String where, String[] whereArgs);  }
@Test public void testIgnored() { insertApp("not installed", "not installed"); insertAndInstallApp("installed, only one version available", 1, 1, false, 0); insertAndInstallApp("installed, already latest, no ignore", 10, 10, false, 0); insertAndInstallApp("installed, already latest, ignore all", 10, 10, true, 0); insertAndInstallApp("installed, already latest, ignore latest", 10, 10, false, 10); insertAndInstallApp("installed, already latest, ignore old", 10, 10, false, 5); insertAndInstallApp("installed, old version, no ignore", 5, 10, false, 0); insertAndInstallApp("installed, old version, ignore all", 5, 10, true, 0); insertAndInstallApp("installed, old version, ignore latest", 5, 10, false, 10); insertAndInstallApp("installed, old version, ignore newer, but not latest", 5, 10, false, 8); assertResultCount(contentResolver, 10, AppProvider.getContentUri(), PROJ); String[] projection = {Cols.Package.PACKAGE_NAME}; List<App> canUpdateApps = AppProvider.Helper.findCanUpdate(context, projection); String[] expectedCanUpdate = { "installed, old version, no ignore", "installed, old version, ignore newer, but not latest", }; assertContainsOnlyIds(canUpdateApps, expectedCanUpdate); }