summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErica Chang <echang@cyngn.com>2016-03-15 19:32:49 -0700
committerRichard MacGregor <rmacgregor@cyngn.com>2016-04-07 13:36:01 -0700
commit132b7de9ed3ca96d613fdff20ccf0e2ebbad0d34 (patch)
tree3815f568a63c528a5c9e8b7a846b5be39c11ef57
parente2b52e9d9a1305259c2c8e237add90178246a7b9 (diff)
downloadpackages_providers_ContactsProvider-132b7de9ed3ca96d613fdff20ccf0e2ebbad0d34.zip
packages_providers_ContactsProvider-132b7de9ed3ca96d613fdff20ccf0e2ebbad0d34.tar.gz
packages_providers_ContactsProvider-132b7de9ed3ca96d613fdff20ccf0e2ebbad0d34.tar.bz2
Contacts: automatic merge count metrics
CD-297 Change-Id: I08250503463b9fa3cedd2f800b20c298cc1b0786
-rw-r--r--Android.mk2
-rw-r--r--AndroidManifest_cm.xml5
-rw-r--r--src/com/android/providers/contacts/aggregation/ContactAggregator2.java11
3 files changed, 18 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk
index 0d4b81a..b13fcce 100644
--- a/Android.mk
+++ b/Android.mk
@@ -10,6 +10,8 @@ LOCAL_SRC_FILES += \
LOCAL_JAVA_LIBRARIES := ext telephony-common
+LOCAL_FULL_LIBS_MANIFEST_FILES := $(LOCAL_PATH)/AndroidManifest_cm.xml
+
LOCAL_STATIC_JAVA_AAR_LIBRARIES := ambientsdk-internal
LOCAL_STATIC_JAVA_LIBRARIES += android-common com.android.vcard guava
diff --git a/AndroidManifest_cm.xml b/AndroidManifest_cm.xml
new file mode 100644
index 0000000..e5e5aff
--- /dev/null
+++ b/AndroidManifest_cm.xml
@@ -0,0 +1,5 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.providers.contacts">
+
+ <uses-permission android:name="com.android.contacts.incall.METRICS_PERMISSION" />
+</manifest>
diff --git a/src/com/android/providers/contacts/aggregation/ContactAggregator2.java b/src/com/android/providers/contacts/aggregation/ContactAggregator2.java
index 5372bbd..133a508 100644
--- a/src/com/android/providers/contacts/aggregation/ContactAggregator2.java
+++ b/src/com/android/providers/contacts/aggregation/ContactAggregator2.java
@@ -19,6 +19,8 @@ package com.android.providers.contacts.aggregation;
import static com.android.providers.contacts.aggregation.util.RawContactMatcher.SCORE_THRESHOLD_PRIMARY;
import static com.android.providers.contacts.aggregation.util.RawContactMatcher.SCORE_THRESHOLD_SECONDARY;
import static com.android.providers.contacts.aggregation.util.RawContactMatcher.SCORE_THRESHOLD_SUGGEST;
+
+import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.provider.ContactsContract.AggregationExceptions;
@@ -71,6 +73,10 @@ public class ContactAggregator2 extends AbstractContactAggregator {
private final RawContactMatcher mMatcher = new RawContactMatcher();
+ private static final String ACTION_CONTACTS_AUTO_MERGE =
+ "com.android.contacts.incall.CONTACTS_AUTO_MERGE";
+ private static final String CONTACT_AUTO_MERGE_KEY_RAW_IDS = "RAW_IDS";
+
/**
* Constructor.
*/
@@ -367,6 +373,11 @@ public class ContactAggregator2 extends AbstractContactAggregator {
if (VERBOSE_LOGGING) {
Log.v(TAG, "Aggregating rids=" + connectedRawContactIds);
}
+ // metrics
+ Intent intent = new Intent(ACTION_CONTACTS_AUTO_MERGE);
+ intent.putExtra(CONTACT_AUTO_MERGE_KEY_RAW_IDS, connectedRids);
+ mContactsProvider.getContext().sendBroadcast(intent);
+
markAggregated(db, connectedRids);
for (Long cid : cidsNeedToBeUpdated) {