Loading java/com/android/contacts/common/model/ContactLoader.java +5 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.text.TextUtils; import com.android.contacts.common.GroupMetaData; import com.android.contacts.common.model.account.AccountType; import com.android.contacts.common.model.account.AccountTypeWithDataSet; import com.android.contacts.common.model.account.GoogleAccountType; import com.android.contacts.common.model.dataitem.DataItem; import com.android.contacts.common.model.dataitem.PhoneDataItem; import com.android.contacts.common.model.dataitem.PhotoDataItem; Loading Loading @@ -727,6 +728,10 @@ public class ContactLoader extends AsyncTaskLoader<Contact> { final String servicePackageName = accountType.getViewContactNotifyServicePackageName(); if (!TextUtils.isEmpty(serviceName) && !TextUtils.isEmpty(servicePackageName)) { final Uri uri = ContentUris.withAppendedId(RawContacts.CONTENT_URI, rawContactId); if (accountType instanceof GoogleAccountType) { ((GoogleAccountType) accountType).handleRawContactViewed(context, uri); continue; } final Intent intent = new Intent(); intent.setClassName(servicePackageName, serviceName); intent.setAction(Intent.ACTION_VIEW); Loading java/com/android/contacts/common/model/account/GoogleAccountType.java +19 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.contacts.common.model.account; import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.provider.ContactsContract.CommonDataKinds.Email; import android.provider.ContactsContract.CommonDataKinds.Event; import android.provider.ContactsContract.CommonDataKinds.Phone; Loading Loading @@ -203,4 +205,21 @@ public class GoogleAccountType extends BaseAccountType { public String getViewContactNotifyServicePackageName() { return PLUS_EXTENSION_PACKAGE_NAME; } /** * Sends a broadcast to the sync adapter to trigger a high res photo sync for the contact which * was viewed * @param context context to send broadcast in * @param rawContactUri Uri of the raw contact viewed */ public void handleRawContactViewed(Context context, Uri rawContactUri) { final Intent intent = new Intent(); intent.setData(rawContactUri); // New broadcast for syncing high res photo. intent.setPackage(GoogleAccountType.PLUS_EXTENSION_PACKAGE_NAME); intent.setAction( "com.google.android.gms.people.sync.focus.SYNC_HIGH_RES_PHOTO"); context.sendBroadcast(intent); } } Loading
java/com/android/contacts/common/model/ContactLoader.java +5 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.text.TextUtils; import com.android.contacts.common.GroupMetaData; import com.android.contacts.common.model.account.AccountType; import com.android.contacts.common.model.account.AccountTypeWithDataSet; import com.android.contacts.common.model.account.GoogleAccountType; import com.android.contacts.common.model.dataitem.DataItem; import com.android.contacts.common.model.dataitem.PhoneDataItem; import com.android.contacts.common.model.dataitem.PhotoDataItem; Loading Loading @@ -727,6 +728,10 @@ public class ContactLoader extends AsyncTaskLoader<Contact> { final String servicePackageName = accountType.getViewContactNotifyServicePackageName(); if (!TextUtils.isEmpty(serviceName) && !TextUtils.isEmpty(servicePackageName)) { final Uri uri = ContentUris.withAppendedId(RawContacts.CONTENT_URI, rawContactId); if (accountType instanceof GoogleAccountType) { ((GoogleAccountType) accountType).handleRawContactViewed(context, uri); continue; } final Intent intent = new Intent(); intent.setClassName(servicePackageName, serviceName); intent.setAction(Intent.ACTION_VIEW); Loading
java/com/android/contacts/common/model/account/GoogleAccountType.java +19 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.contacts.common.model.account; import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.provider.ContactsContract.CommonDataKinds.Email; import android.provider.ContactsContract.CommonDataKinds.Event; import android.provider.ContactsContract.CommonDataKinds.Phone; Loading Loading @@ -203,4 +205,21 @@ public class GoogleAccountType extends BaseAccountType { public String getViewContactNotifyServicePackageName() { return PLUS_EXTENSION_PACKAGE_NAME; } /** * Sends a broadcast to the sync adapter to trigger a high res photo sync for the contact which * was viewed * @param context context to send broadcast in * @param rawContactUri Uri of the raw contact viewed */ public void handleRawContactViewed(Context context, Uri rawContactUri) { final Intent intent = new Intent(); intent.setData(rawContactUri); // New broadcast for syncing high res photo. intent.setPackage(GoogleAccountType.PLUS_EXTENSION_PACKAGE_NAME); intent.setAction( "com.google.android.gms.people.sync.focus.SYNC_HIGH_RES_PHOTO"); context.sendBroadcast(intent); } }