use of android.content.ContentValues in project android-job by evernote.
the class JobRequest method setTransient.
/*package*/
void setTransient(boolean isTransient) {
mTransient = isTransient;
ContentValues contentValues = new ContentValues();
contentValues.put(JobStorage.COLUMN_TRANSIENT, mTransient);
JobManager.instance().getJobStorage().update(this, contentValues);
}
use of android.content.ContentValues in project materialistic by hidroh.
the class ReadabilityClientTest method testEmptyCachedContent.
@Test
public void testEmptyCachedContent() {
ContentValues cv = new ContentValues();
cv.put("itemid", "1");
cv.put("content", "<div></div>");
resolver.insert(MaterialisticProvider.URI_READABILITY, cv);
client.parse("1", "http://example.com/article.html", callback);
verify(TestRestServiceFactory.mercuryService, never()).parse(any());
verify(callback).onResponse((String) isNull());
}
use of android.content.ContentValues in project materialistic by hidroh.
the class SessionManagerTest method setUp.
@Before
public void setUp() {
resolver = shadowOf(RuntimeEnvironment.application.getContentResolver());
ContentValues cv = new ContentValues();
cv.put("itemid", "1");
resolver.insert(MaterialisticProvider.URI_VIEWED, cv);
cv = new ContentValues();
cv.put("itemid", "2");
resolver.insert(MaterialisticProvider.URI_VIEWED, cv);
manager = new SessionManager(Schedulers.immediate());
}
use of android.content.ContentValues in project materialistic by hidroh.
the class FavoriteManagerTest method setUp.
@Before
public void setUp() {
resolver = shadowOf(RuntimeEnvironment.application.getContentResolver());
ContentValues cv = new ContentValues();
cv.put("itemid", "1");
cv.put("title", "title");
cv.put("url", "http://example.com");
cv.put("time", String.valueOf(System.currentTimeMillis()));
resolver.insert(MaterialisticProvider.URI_FAVORITE, cv);
cv = new ContentValues();
cv.put("itemid", "2");
cv.put("title", "ask HN");
cv.put("url", "http://example.com");
cv.put("time", String.valueOf(System.currentTimeMillis()));
resolver.insert(MaterialisticProvider.URI_FAVORITE, cv);
manager = new FavoriteManager(Schedulers.immediate()) {
@Override
protected Uri getUriForFile(Context context, File file) {
return Uri.parse("content://" + FavoriteManager.FILE_AUTHORITY + "/files/saved/materialistic-export.txt");
}
};
}
use of android.content.ContentValues in project qksms by moezbhatti.
the class MessageUtils method lockMessage.
public static void lockMessage(Context context, MessageItem msgItem, boolean locked) {
Uri uri;
if ("sms".equals(msgItem.mType)) {
uri = Sms.CONTENT_URI;
} else {
uri = Mms.CONTENT_URI;
}
final Uri lockUri = ContentUris.withAppendedId(uri, msgItem.mMsgId);
final ContentValues values = new ContentValues(1);
values.put("locked", locked ? 1 : 0);
new Thread(() -> {
context.getContentResolver().update(lockUri, values, null, null);
}, "MainActivity.lockMessage").start();
}
Aggregations