use of org.robolectric.annotation.Implementation in project robolectric by robolectric.
the class ShadowContentResolver method delete.
@Implementation
public final int delete(Uri url, String where, String[] selectionArgs) {
ContentProvider provider = getProvider(url);
if (provider != null) {
return provider.delete(url, where, selectionArgs);
} else {
DeleteStatement deleteStatement = new DeleteStatement(url, where, selectionArgs);
deleteStatements.add(deleteStatement);
return 1;
}
}
use of org.robolectric.annotation.Implementation in project robolectric by robolectric.
the class ShadowContentResolver method query.
@Implementation
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder, CancellationSignal cancellationSignal) {
ContentProvider provider = getProvider(uri);
if (provider != null) {
return provider.query(uri, projection, selection, selectionArgs, sortOrder, cancellationSignal);
} else {
BaseCursor returnCursor = getCursor(uri);
if (returnCursor == null) {
return null;
}
returnCursor.setQuery(uri, projection, selection, selectionArgs, sortOrder);
return returnCursor;
}
}
use of org.robolectric.annotation.Implementation in project robolectric by robolectric.
the class ShadowContentResolver method addPeriodicSync.
@Implementation
public static void addPeriodicSync(Account account, String authority, Bundle extras, long pollFrequency) {
validateSyncExtrasBundle(extras);
removePeriodicSync(account, authority, extras);
getStatus(account, authority, true).syncs.add(new PeriodicSync(account, authority, extras, pollFrequency));
}
use of org.robolectric.annotation.Implementation in project robolectric by robolectric.
the class ShadowContentResolver method update.
@Implementation
public int update(Uri uri, ContentValues values, String where, String[] selectionArgs) {
ContentProvider provider = getProvider(uri);
if (provider != null) {
return provider.update(uri, values, where, selectionArgs);
} else {
UpdateStatement updateStatement = new UpdateStatement(uri, new ContentValues(values), where, selectionArgs);
updateStatements.add(updateStatement);
return ++nextDatabaseIdForUpdates;
}
}
use of org.robolectric.annotation.Implementation in project robolectric by robolectric.
the class ShadowResources method loadDrawable.
@Implementation
public Drawable loadDrawable(TypedValue value, int id, Resources.Theme theme) throws Resources.NotFoundException {
Drawable drawable = directlyOn(realResources, Resources.class, "loadDrawable", ClassParameter.from(TypedValue.class, value), ClassParameter.from(int.class, id), ClassParameter.from(Resources.Theme.class, theme));
setCreatedFromResId(realResources, id, drawable);
return drawable;
}
Aggregations