Home | History | Annotate | Download | only in platform

Lines Matching refs:rawContact

20 import com.example.android.samplesync.client.RawContact;
106 List<RawContact> rawContacts, long groupId, long lastSyncMarker) {
111 final List<RawContact> newUsers = new ArrayList<RawContact>();
114 for (final RawContact rawContact : rawContacts) {
121 if (rawContact.getSyncState() > currentSyncMarker) {
122 currentSyncMarker = rawContact.getSyncState();
132 if (rawContact.getRawContactId() > 0) {
133 rawContactId = rawContact.getRawContactId();
136 long serverContactId = rawContact.getServerContactId();
141 if (!rawContact.isDeleted()) {
142 updateContact(context, resolver, rawContact, updateServerId,
149 if (!rawContact.isDeleted()) {
150 newUsers.add(rawContact);
151 addContact(context, account, rawContact, groupId, true, batchOperation);
174 public static List<RawContact> getDirtyContacts(Context context, Account account) {
176 List<RawContact> dirtyContacts = new ArrayList<RawContact>();
202 RawContact rawContact = RawContact.createDeletedContact(rawContactId,
204 dirtyContacts.add(rawContact);
206 RawContact rawContact = getRawContact(context, rawContactId);
207 Log.i(TAG, "Contact Name: " + rawContact.getBestName());
208 dirtyContacts.add(rawContact);
228 public static void updateStatusMessages(Context context, List<RawContact> rawContacts) {
231 for (RawContact rawContact : rawContacts) {
232 updateContactStatus(context, rawContact, batchOperation);
249 public static void clearSyncFlags(Context context, List<RawContact> dirtyContacts) {
253 for (RawContact rawContact : dirtyContacts) {
254 if (rawContact.isDeleted()) {
255 Log.i(TAG, "Deleting contact: " + Long.toString(rawContact.getRawContactId()));
256 deleteContact(context, rawContact.getRawContactId(), batchOperation);
257 } else if (rawContact.isDirty()) {
258 Log.i(TAG, "Clearing dirty flag for: " + rawContact.getBestName());
259 clearDirtyFlag(context, rawContact.getRawContactId(), batchOperation);
273 * @param rawContact the sample SyncAdapter User object
279 public static void addContact(Context context, String accountName, RawContact rawContact,
284 context, rawContact.getServerContactId(), accountName, inSync, batchOperation);
286 contactOp.addName(rawContact.getFullName(), rawContact.getFirstName(),
287 rawContact.getLastName())
288 .addEmail(rawContact.getEmail())
289 .addPhone(rawContact.getCellPhone(), Phone.TYPE_MOBILE)
290 .addPhone(rawContact.getHomePhone(), Phone.TYPE_HOME)
291 .addPhone(rawContact.getOfficePhone(), Phone.TYPE_WORK)
293 .addAvatar(rawContact.getAvatarUrl());
298 if (rawContact.getServerContactId() > 0) {
299 contactOp.addProfileAction(rawContact.getServerContactId());
318 * @param rawContact the sample SyncAdapter contact object
322 * @param rawContactId the unique Id for this rawContact in contacts
328 RawContact rawContact, boolean updateServerId, boolean updateStatus, boolean updateAvatar,
355 rawContact.getFirstName(),
356 rawContact.getLastName(),
357 rawContact.getFullName());
363 rawContact.getCellPhone(), uri);
367 rawContact.getHomePhone(), uri);
371 rawContact.getOfficePhone(), uri);
375 contactOp.updateEmail(rawContact.getEmail(),
379 contactOp.updateAvatar(rawContact.getAvatarUrl(), uri);
388 contactOp.addPhone(rawContact.getCellPhone(), Phone.TYPE_MOBILE);
392 contactOp.addPhone(rawContact.getHomePhone(), Phone.TYPE_HOME);
397 contactOp.addPhone(rawContact.getOfficePhone(), Phone.TYPE_WORK);
401 contactOp.addEmail(rawContact.getEmail());
405 contactOp.addAvatar(rawContact.getAvatarUrl());
416 contactOp.updateServerId(rawContact.getServerContactId(), uri);
422 final long serverId = rawContact.getServerContactId();
462 private static RawContact getRawContact(Context context, long rawContactId) {
508 RawContact rawContact = RawContact.create(fullName, firstName, lastName, cellPhone,
511 return rawContact;
521 * @param rawContact the contact whose status we should update
524 private static void updateContactStatus(Context context, RawContact rawContact,
529 final long userId = rawContact.getServerContactId();
530 final String username = rawContact.getUserName();
531 final String status = rawContact.getStatus();
576 * @param rawContactId the unique Id for this rawContact in contacts
588 * Returns the RawContact id for a sample SyncAdapter contact, or 0 if the
593 * @return the RawContact id, or 0 if not found