am 3c7f0d4c
: Make exchange contact category names visible; also their members
Merge commit '3c7f0d4c000f24e39fb4b0f1e10f762f5ff011c9' into eclair-plus-aosp * commit '3c7f0d4c000f24e39fb4b0f1e10f762f5ff011c9': Make exchange contact category names visible; also their members
This commit is contained in:
commit
bb1b993808
@ -112,7 +112,9 @@ public class ContactsSyncAdapter extends AbstractSyncAdapter {
|
|||||||
ArrayList<Long> mDeletedIdList = new ArrayList<Long>();
|
ArrayList<Long> mDeletedIdList = new ArrayList<Long>();
|
||||||
ArrayList<Long> mUpdatedIdList = new ArrayList<Long>();
|
ArrayList<Long> mUpdatedIdList = new ArrayList<Long>();
|
||||||
|
|
||||||
android.accounts.Account mAccountManagerAccount;
|
private boolean mGroupsUsed = false;
|
||||||
|
|
||||||
|
private android.accounts.Account mAccountManagerAccount;
|
||||||
|
|
||||||
public ContactsSyncAdapter(Mailbox mailbox, EasSyncService service) {
|
public ContactsSyncAdapter(Mailbox mailbox, EasSyncService service) {
|
||||||
super(mailbox, service);
|
super(mailbox, service);
|
||||||
@ -522,14 +524,11 @@ public class ContactsSyncAdapter extends AbstractSyncAdapter {
|
|||||||
ops.addNote(entity, getValue());
|
ops.addNote(entity, getValue());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// TODO Handle Categories/Category
|
|
||||||
// If we don't handle this properly, we'll lose the information if/when we
|
|
||||||
// upload changes to the server!
|
|
||||||
case Tags.CONTACTS_CATEGORIES:
|
case Tags.CONTACTS_CATEGORIES:
|
||||||
|
mGroupsUsed = true;
|
||||||
categoriesParser(ops, entity);
|
categoriesParser(ops, entity);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case Tags.CONTACTS_COMPRESSED_RTF:
|
case Tags.CONTACTS_COMPRESSED_RTF:
|
||||||
// We don't use this, and it isn't necessary to upload, so we'll ignore it
|
// We don't use this, and it isn't necessary to upload, so we'll ignore it
|
||||||
skipTag();
|
skipTag();
|
||||||
@ -1379,6 +1378,28 @@ public class ContactsSyncAdapter extends AbstractSyncAdapter {
|
|||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
ops.execute();
|
ops.execute();
|
||||||
|
ContentResolver cr = mContext.getContentResolver();
|
||||||
|
if (mGroupsUsed) {
|
||||||
|
// Make sure the title column is set for all of our groups
|
||||||
|
// And that all of our groups are visible
|
||||||
|
// TODO Perhaps the visible part should only happen when the group is created, but
|
||||||
|
// this is fine for now.
|
||||||
|
Uri groupsUri = uriWithAccount(Groups.CONTENT_URI);
|
||||||
|
Cursor c = cr.query(groupsUri, new String[] {Groups.SOURCE_ID, Groups.TITLE},
|
||||||
|
Groups.TITLE + " IS NULL", null, null);
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
values.put(Groups.GROUP_VISIBLE, 1);
|
||||||
|
try {
|
||||||
|
while (c.moveToNext()) {
|
||||||
|
String sourceId = c.getString(0);
|
||||||
|
values.put(Groups.TITLE, sourceId);
|
||||||
|
cr.update(uriWithAccount(groupsUri), values, Groups.SOURCE_ID + "=?",
|
||||||
|
new String[] {sourceId});
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
c.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user