summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
Diffstat (limited to 'InCallUI')
-rw-r--r--InCallUI/src/com/android/incallui/CallCardPresenter.java3
-rw-r--r--InCallUI/src/com/android/incallui/CallerInfoUtils.java20
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);
+ }
}