@ -8,9 +8,6 @@ package com.todoroo.astrid.people;
import java.util.ArrayList ;
import java.util.ArrayList ;
import java.util.List ;
import java.util.List ;
import org.json.JSONException ;
import org.json.JSONObject ;
import android.content.BroadcastReceiver ;
import android.content.BroadcastReceiver ;
import android.content.ComponentName ;
import android.content.ComponentName ;
import android.content.ContentValues ;
import android.content.ContentValues ;
@ -30,7 +27,6 @@ import com.todoroo.andlib.sql.Order;
import com.todoroo.andlib.sql.Query ;
import com.todoroo.andlib.sql.Query ;
import com.todoroo.andlib.sql.QueryTemplate ;
import com.todoroo.andlib.sql.QueryTemplate ;
import com.todoroo.astrid.actfm.sync.ActFmPreferenceService ;
import com.todoroo.astrid.actfm.sync.ActFmPreferenceService ;
import com.todoroo.astrid.actfm.sync.ActFmSyncService ;
import com.todoroo.astrid.api.AstridApiConstants ;
import com.todoroo.astrid.api.AstridApiConstants ;
import com.todoroo.astrid.api.Filter ;
import com.todoroo.astrid.api.Filter ;
import com.todoroo.astrid.api.FilterListItem ;
import com.todoroo.astrid.api.FilterListItem ;
@ -80,7 +76,7 @@ public class PeopleFilterExposer extends BroadcastReceiver {
}
}
}
}
@SuppressWarnings ( "nls" )
@SuppressWarnings ( { "nls" , "deprecation" } )
private static FilterWithCustomIntent filterFromUserData ( User user ) {
private static FilterWithCustomIntent filterFromUserData ( User user ) {
String title = user . getDisplayName ( ) ;
String title = user . getDisplayName ( ) ;
if ( TextUtils . isEmpty ( title ) | | "null" . equals ( title ) )
if ( TextUtils . isEmpty ( title ) | | "null" . equals ( title ) )
@ -91,8 +87,8 @@ public class PeopleFilterExposer extends BroadcastReceiver {
if ( TextUtils . isEmpty ( email ) | | "null" . equals ( email ) )
if ( TextUtils . isEmpty ( email ) | | "null" . equals ( email ) )
criterion = Task . USER_ID . eq ( user . getValue ( User . REMOTE_ID ) ) ;
criterion = Task . USER_ID . eq ( user . getValue ( User . REMOTE_ID ) ) ;
else
else
criterion = Criterion . or ( Task . USER . like ( "%" + email + "%" ) ,
criterion = Criterion . or ( Task . USER _ID. eq ( user . getValue ( User . UUID ) ) ,
Task . USER _ID. eq ( user . getValue ( User . REMOTE_ID ) ) ) ;
Task . USER . like ( "%" + email + "%" ) ) ; // Deprecated field OK for backwards compatibility
criterion = Criterion . and ( TaskCriteria . activeAndVisible ( ) , criterion ) ;
criterion = Criterion . and ( TaskCriteria . activeAndVisible ( ) , criterion ) ;
@ -103,14 +99,7 @@ public class PeopleFilterExposer extends BroadcastReceiver {
filter . customTaskList = new ComponentName ( ContextManager . getContext ( ) , PersonViewFragment . class ) ;
filter . customTaskList = new ComponentName ( ContextManager . getContext ( ) , PersonViewFragment . class ) ;
ContentValues values = new ContentValues ( ) ;
ContentValues values = new ContentValues ( ) ;
values . put ( Task . USER_ID . name , user . getValue ( User . REMOTE_ID ) ) ;
values . put ( Task . USER_ID . name , user . getValue ( User . UUID ) ) ;
try {
JSONObject userJson = new JSONObject ( ) ;
ActFmSyncService . JsonHelper . jsonFromUser ( userJson , user ) ;
values . put ( Task . USER . name , userJson . toString ( ) ) ;
} catch ( JSONException e ) {
// Ignored
}
filter . valuesForNewTasks = values ;
filter . valuesForNewTasks = values ;
String imageUrl = user . getValue ( User . PICTURE ) ;
String imageUrl = user . getValue ( User . PICTURE ) ;