diff options
author | Yorke Lee <yorkelee@google.com> | 2013-10-02 14:31:09 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-10-02 14:31:09 -0700 |
commit | a3e72806244a49f967817bbe7d6335965add7108 (patch) | |
tree | b74f4c76b3bff5ba69260e1362d7016dd5086e19 | |
parent | f25b6f54a1a8d3b2053d9e066f2b79c553353394 (diff) | |
parent | 9c57ab2ae80c783b6ce8131adcaa8aaa20583692 (diff) |
am f435a00d: am 971d2ae7: am d1ff1e84: Merge "Send view notification for viewed contact in IncallUI" into klp-dev
* commit 'f435a00d652aa9a78d26511e14db8eecb7d15a85':
Send view notification for viewed contact in IncallUI
-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); + } } |