diff options
author | Yorke Lee <yorkelee@google.com> | 2013-10-02 20:10:21 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-10-02 20:10:21 +0000 |
commit | 1d6e5d13ca294388299f7c80dcbc14fe7872ddd4 (patch) | |
tree | b74f4c76b3bff5ba69260e1362d7016dd5086e19 | |
parent | 0c09e53d0f5cbaaab22628b93708911de979e8a6 (diff) | |
parent | 7e7fd2a0642515834a96028937f60ec955edfd91 (diff) |
Merge "Send view notification for viewed contact in IncallUI" into klp-dev
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardPresenter.java | 3 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/CallerInfoUtils.java | 20 |
2 files changed, 22 insertions, 1 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index 4ff4d6523..949d71891 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -261,6 +261,9 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> if (entry.name != null) { Log.d(TAG, "Contact found: " + entry); } + if (entry.personUri != null) { + CallerInfoUtils.sendViewNotification(mContext, entry.personUri); + } } @Override diff --git a/InCallUI/src/com/android/incallui/CallerInfoUtils.java b/InCallUI/src/com/android/incallui/CallerInfoUtils.java index 2971a2954..3d2c5c4a7 100644 --- a/InCallUI/src/com/android/incallui/CallerInfoUtils.java +++ b/InCallUI/src/com/android/incallui/CallerInfoUtils.java @@ -1,6 +1,8 @@ package com.android.incallui; import android.content.Context; +import android.content.Intent; +import android.net.Uri; import android.text.TextUtils; import com.android.services.telephony.common.Call; @@ -9,7 +11,7 @@ import com.android.services.telephony.common.CallIdentification; import java.util.Arrays; /** - * TODO: Insert description here. (generated by yorkelee) + * Utility methods for contact and caller info related functionality */ public class CallerInfoUtils { @@ -18,6 +20,12 @@ public class CallerInfoUtils { /** Define for not a special CNAP string */ private static final int CNAP_SPECIAL_CASE_NO = -1; + private static final String VIEW_NOTIFICATION_ACTION = + "com.android.contacts.VIEW_NOTIFICATION"; + private static final String VIEW_NOTIFICATION_PACKAGE = "com.android.contacts"; + private static final String VIEW_NOTIFICATION_CLASS = + "com.android.contacts.ViewNotificationService"; + public CallerInfoUtils() { } @@ -172,4 +180,14 @@ public class CallerInfoUtils { } return builder.toString(); } + + /** + * Send a notification that that we are viewing a particular contact, so that the high-res + * photo is downloaded by the sync adapter. + */ + public static void sendViewNotification(Context context, Uri contactUri) { + final Intent intent = new Intent(VIEW_NOTIFICATION_ACTION, contactUri); + intent.setClassName(VIEW_NOTIFICATION_PACKAGE, VIEW_NOTIFICATION_CLASS); + context.startService(intent); + } } |