summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2013-10-02 14:29:38 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-02 14:29:38 -0700
commit9c57ab2ae80c783b6ce8131adcaa8aaa20583692 (patch)
tree617beac9e14b1193db8ccf2b78898405ac6b355f
parentd78370798462d6ba009c84d275cd97c01cd35181 (diff)
parent5f201e07b5d049e2af563c88be2e6e9b648bc3a6 (diff)
am 971d2ae7: am d1ff1e84: Merge "Send view notification for viewed contact in IncallUI" into klp-dev
* commit '971d2ae762b49ce4c5e1f511f95098aba04e8edd': Send view notification for viewed contact in 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);
+ }
}