/** * Creates an update {@link ContentProviderOperation} for the {@link App} in question. * <strong>Does not do any checks to see if the app already exists or not.</strong> */ private ContentProviderOperation updateExistingApp(App app) { Uri uri = TempAppProvider.getAppUri(app); ContentValues values = app.toContentValues(); for (final String toIgnore : APP_FIELDS_TO_IGNORE) { if (values.containsKey(toIgnore)) { values.remove(toIgnore); } } return ContentProviderOperation.newUpdate(uri).withValues(values).build(); }
/** * Creates an insert {@link ContentProviderOperation} for the {@link App} in question. * <strong>Does not do any checks to see if the app already exists or not.</strong> */ private ContentProviderOperation insertNewApp(App app) { ContentValues values = app.toContentValues(); Uri uri = TempAppProvider.getContentUri(); return ContentProviderOperation.newInsert(uri).withValues(values).build(); }