Skip to content
This repository was archived by the owner on Aug 17, 2020. It is now read-only.

Commit c6db534

Browse files
committed
Merge pull request #54 from square/jw/remove-worker-thread
Comment out worker thread annotations for now.
2 parents c52ccb8 + 65c4f39 commit c6db534

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

sqlbrite/src/main/java/com/squareup/sqlbrite/BriteDatabase.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import android.support.annotation.IntDef;
2525
import android.support.annotation.NonNull;
2626
import android.support.annotation.Nullable;
27-
import android.support.annotation.WorkerThread;
2827
import com.squareup.sqlbrite.SqlBrite.Query;
2928
import java.io.Closeable;
3029
import java.io.IOException;
@@ -312,7 +311,7 @@ private QueryObservable createQuery(final Func1<Set<String>, Boolean> tableFilte
312311
*
313312
* @see SQLiteDatabase#rawQuery(String, String[])
314313
*/
315-
@CheckResult @WorkerThread
314+
@CheckResult // TODO @WorkerThread
316315
public Cursor query(@NonNull String sql, @NonNull String... args) {
317316
if (logging) log("QUERY\n sql: %s\n args: %s", sql, Arrays.toString(args));
318317
return getReadableDatabase().rawQuery(sql, args);
@@ -323,7 +322,7 @@ public Cursor query(@NonNull String sql, @NonNull String... args) {
323322
*
324323
* @see SQLiteDatabase#insert(String, String, ContentValues)
325324
*/
326-
@WorkerThread
325+
// TODO @WorkerThread
327326
public long insert(@NonNull String table, @NonNull ContentValues values) {
328327
return insert(table, values, CONFLICT_NONE);
329328
}
@@ -333,7 +332,7 @@ public long insert(@NonNull String table, @NonNull ContentValues values) {
333332
*
334333
* @see SQLiteDatabase#insertWithOnConflict(String, String, ContentValues, int)
335334
*/
336-
@WorkerThread
335+
// TODO @WorkerThread
337336
public long insert(@NonNull String table, @NonNull ContentValues values,
338337
@ConflictAlgorithm int conflictAlgorithm) {
339338
SQLiteDatabase db = getWriteableDatabase();
@@ -359,7 +358,7 @@ public long insert(@NonNull String table, @NonNull ContentValues values,
359358
*
360359
* @see SQLiteDatabase#delete(String, String, String[])
361360
*/
362-
@WorkerThread
361+
// TODO @WorkerThread
363362
public int delete(@NonNull String table, @Nullable String whereClause,
364363
@Nullable String... whereArgs) {
365364
SQLiteDatabase db = getWriteableDatabase();
@@ -385,7 +384,7 @@ public int delete(@NonNull String table, @Nullable String whereClause,
385384
*
386385
* @see SQLiteDatabase#update(String, ContentValues, String, String[])
387386
*/
388-
@WorkerThread
387+
// TODO @WorkerThread
389388
public int update(@NonNull String table, @NonNull ContentValues values,
390389
@Nullable String whereClause, @Nullable String... whereArgs) {
391390
return update(table, values, CONFLICT_NONE, whereClause, whereArgs);
@@ -397,7 +396,7 @@ public int update(@NonNull String table, @NonNull ContentValues values,
397396
*
398397
* @see SQLiteDatabase#updateWithOnConflict(String, ContentValues, String, String[], int)
399398
*/
400-
@WorkerThread
399+
// TODO @WorkerThread
401400
public int update(@NonNull String table, @NonNull ContentValues values,
402401
@ConflictAlgorithm int conflictAlgorithm, @Nullable String whereClause,
403402
@Nullable String... whereArgs) {
@@ -427,7 +426,7 @@ public interface Transaction extends Closeable {
427426
*
428427
* @see SQLiteDatabase#endTransaction()
429428
*/
430-
@WorkerThread
429+
// TODO @WorkerThread
431430
void end();
432431

433432
/**
@@ -438,7 +437,7 @@ public interface Transaction extends Closeable {
438437
*
439438
* @see SQLiteDatabase#setTransactionSuccessful()
440439
*/
441-
@WorkerThread
440+
// TODO @WorkerThread
442441
void markSuccessful();
443442

444443
/**
@@ -452,7 +451,7 @@ public interface Transaction extends Closeable {
452451
*
453452
* @see SQLiteDatabase#yieldIfContendedSafely()
454453
*/
455-
@WorkerThread
454+
// TODO @WorkerThread
456455
boolean yieldIfContendedSafely();
457456

458457
/**
@@ -469,13 +468,13 @@ public interface Transaction extends Closeable {
469468
*
470469
* @see SQLiteDatabase#yieldIfContendedSafely(long)
471470
*/
472-
@WorkerThread
471+
// TODO @WorkerThread
473472
boolean yieldIfContendedSafely(long sleepAmount, TimeUnit sleepUnit);
474473

475474
/**
476475
* Equivalent to calling {@link #end()}
477476
*/
478-
@WorkerThread
477+
// TODO @WorkerThread
479478
@Override void close();
480479
}
481480

sqlbrite/src/main/java/com/squareup/sqlbrite/SqlBrite.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import android.database.sqlite.SQLiteOpenHelper;
2121
import android.support.annotation.CheckResult;
2222
import android.support.annotation.NonNull;
23-
import android.support.annotation.WorkerThread;
2423
import android.util.Log;
2524
import rx.Observable;
2625
import rx.Subscriber;
@@ -73,7 +72,7 @@ public BriteContentResolver wrapContentProvider(@NonNull ContentResolver content
7372
/** An executable query. */
7473
public static abstract class Query {
7574
/** Execute the query on the underlying database and return the resulting cursor. */
76-
@CheckResult @WorkerThread
75+
@CheckResult // TODO @WorkerThread
7776
// TODO Implementations might return null, which is gross. Throw?
7877
public abstract Cursor run();
7978

0 commit comments

Comments
 (0)