diff --git a/api/src/com/todoroo/andlib/sql/Functions.java b/api/src/com/todoroo/andlib/sql/Functions.java index 88f6a9d21..9770fcfdc 100644 --- a/api/src/com/todoroo/andlib/sql/Functions.java +++ b/api/src/com/todoroo/andlib/sql/Functions.java @@ -1,5 +1,6 @@ package com.todoroo.andlib.sql; +import com.todoroo.andlib.data.Property.IntegerProperty; import com.todoroo.andlib.data.Property.StringProperty; @@ -50,4 +51,8 @@ public final class Functions { return new Field("LENGTH(" + field.toString() + ")"); } + public static Field bitwiseAnd(IntegerProperty field, int value) { + return new Field(field.toString() + " & " + value); + } + } diff --git a/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java b/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java index 9d614e26a..200d9d3ef 100644 --- a/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java +++ b/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java @@ -770,7 +770,8 @@ public class TaskListActivity extends ListActivity implements OnScrollListener, @Override public void onClick(DialogInterface dialog, int which) { String nameLike = "%" + assignedEmail + "%"; - TodorooCursor c = tagDataService.query(Query.select(TagData.NAME, TagData.TASK_COUNT, TagData.REMOTE_ID).where(Criterion.and(TagData.FLAGS.gte(TagData.FLAG_EMERGENT), TagData.MEMBERS.like(nameLike)))); + TodorooCursor c = tagDataService.query(Query.select(TagData.NAME, TagData.TASK_COUNT, TagData.REMOTE_ID).where(Criterion.and( + Functions.bitwiseAnd(TagData.FLAGS, TagData.FLAG_EMERGENT).gt(0), TagData.MEMBERS.like(nameLike)))); try { if (c.getCount() > 0) { c.moveToFirst();