summaryrefslogtreecommitdiff
path: root/tests/src/com
diff options
context:
space:
mode:
authorTony Mak <tonymak@google.com>2016-02-22 19:58:42 +0000
committerTony Mak <tonymak@google.com>2016-02-22 19:58:42 +0000
commit83583b735686aa02119f5754f77eb9f0d318fe44 (patch)
tree51e57a37b703698a70dcd7b24dfa37b94ff74aa2 /tests/src/com
parent3fc59a42bb9911ab436bd4304483a28dc7c029b3 (diff)
Show Briefcase icon not displayed in in-call UI for work SIP calls
Current dialer always queries PhoneLookup._ID and uses this as a contact ID. In pre-N, contact id of non-sip query is stored in PhoneLookup._ID and it is actually a mistake. This problem does not exist in sip query, and contact id of sip query is stored in Data.CONTACT_ID. So it is a "bug" in dialer that we use PhoneLooup._ID for sip query as it is not really a contacat id. The bug of missing work badge may not be the only issue introduced by this. In N, the issue is get fixed in framework, PhoneLookup.CONTACT_ID is introduced. We should access PhoneLookup.CONTACT_ID no matter what phone lookup query we are having. The ideal case is we always use PhoneLookup.CONTACT_ID for retrieving contact id, but given that we need to support in pre-N, we need to query PhoneLookup._ID for contact id in non-sip query in pre-N. BUG:27242975 Change-Id: Id14378e3dce5b07629ffe0c6e83c3d107fbb468e
Diffstat (limited to 'tests/src/com')
-rw-r--r--tests/src/com/android/dialer/calllog/ContactInfoHelperTest.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/src/com/android/dialer/calllog/ContactInfoHelperTest.java b/tests/src/com/android/dialer/calllog/ContactInfoHelperTest.java
index 0e032c15f..680afb15f 100644
--- a/tests/src/com/android/dialer/calllog/ContactInfoHelperTest.java
+++ b/tests/src/com/android/dialer/calllog/ContactInfoHelperTest.java
@@ -63,7 +63,7 @@ public class ContactInfoHelperTest extends AndroidTestCase {
public void testLookupContactFromUri_NoResults() {
setUpQueryExpectations(PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI,
- PhoneQuery.PHONE_LOOKUP_PROJECTION);
+ PhoneQuery.getPhoneLookupProjection(PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI));
Assert.assertEquals(ContactInfo.EMPTY, mContactInfoHelper.lookupContactFromUri(
PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI, false));
@@ -72,7 +72,8 @@ public class ContactInfoHelperTest extends AndroidTestCase {
public void testLookupContactFromUri_NoDisplayNameAlternative() {
setUpQueryExpectations(PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI,
- PhoneQuery.PHONE_LOOKUP_PROJECTION, TEST_LOOKUP_ROW);
+ PhoneQuery.getPhoneLookupProjection(PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI),
+ TEST_LOOKUP_ROW);
setUpQueryExpectations(displayNameAlternativeUri,
PhoneQuery.DISPLAY_NAME_ALTERNATIVE_PROJECTION);
@@ -85,7 +86,8 @@ public class ContactInfoHelperTest extends AndroidTestCase {
public void testLookupContactFromUri_HasDisplayNameAlternative() {
setUpQueryExpectations(PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI,
- PhoneQuery.PHONE_LOOKUP_PROJECTION, TEST_LOOKUP_ROW);
+ PhoneQuery.getPhoneLookupProjection(PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI),
+ TEST_LOOKUP_ROW);
setUpQueryExpectations(displayNameAlternativeUri,
PhoneQuery.DISPLAY_NAME_ALTERNATIVE_PROJECTION, TEST_DISPLAY_NAME_ALTERNATIVE_ROW);