Message ContentProvider field rename from READED to UNREAD to maintain

names consistency.
This commit is contained in:
João Pedro Taveira 2011-05-02 16:00:04 +01:00
parent 591d7a3c6f
commit af7d57561f

View file

@ -17,6 +17,7 @@ import android.content.ContentProvider;
import android.content.ContentResolver; import android.content.ContentResolver;
import android.content.ContentValues; import android.content.ContentValues;
import android.content.Context; import android.content.Context;
import android.content.Intent;
import android.content.UriMatcher; import android.content.UriMatcher;
import android.database.CharArrayBuffer; import android.database.CharArrayBuffer;
import android.database.ContentObserver; import android.database.ContentObserver;
@ -75,7 +76,7 @@ public class MessageProvider extends ContentProvider {
/** /**
* <P>Type: BOOLEAN</P> * <P>Type: BOOLEAN</P>
*/ */
String READED = "readed"; String UNREAD = "unread";
String ACCOUNT = "account"; String ACCOUNT = "account";
String URI = "uri"; String URI = "uri";
@ -187,10 +188,10 @@ public class MessageProvider extends ContentProvider {
} }
} }
public static class ReadedExtractor implements FieldExtractor<MessageInfoHolder, Boolean> { public static class UnreadExtractor implements FieldExtractor<MessageInfoHolder, Boolean> {
@Override @Override
public Boolean getField(final MessageInfoHolder source) { public Boolean getField(final MessageInfoHolder source) {
return source.read; return !source.read;
} }
} }
@ -302,8 +303,8 @@ public class MessageProvider extends ContentProvider {
extractors.put(field, new DeleteUriExtractor()); extractors.put(field, new DeleteUriExtractor());
} else if (MessageColumns.ACCOUNT.equals(field)) { } else if (MessageColumns.ACCOUNT.equals(field)) {
extractors.put(field, new AccountExtractor()); extractors.put(field, new AccountExtractor());
} else if (MessageColumns.READED.equals(field)) { } else if (MessageColumns.UNREAD.equals(field)) {
extractors.put(field, new ReadedExtractor()); extractors.put(field, new UnreadExtractor());
} else if (MessageColumns.INCREMENT.equals(field)) { } else if (MessageColumns.INCREMENT.equals(field)) {
extractors.put(field, new IncrementExtractor()); extractors.put(field, new IncrementExtractor());
} }
@ -819,7 +820,7 @@ public class MessageProvider extends ContentProvider {
MessageColumns.SUBJECT, MessageColumns.SUBJECT,
MessageColumns.PREVIEW, MessageColumns.PREVIEW,
MessageColumns.ACCOUNT, MessageColumns.ACCOUNT,
MessageColumns.READED, MessageColumns.UNREAD,
MessageColumns.URI, MessageColumns.URI,
MessageColumns.DELETE_URI MessageColumns.DELETE_URI
}; };