diff options
author | Makoto Onuki <omakoto@google.com> | 2015-03-18 16:36:27 -0700 |
---|---|---|
committer | Makoto Onuki <omakoto@google.com> | 2015-03-30 16:28:57 -0700 |
commit | 1076c4946c230612c8eb56dbcdf2e3ca22a624e3 (patch) | |
tree | 95fb0cc1d2d70902b33e05b67be7b8020c4c44e3 | |
parent | 889f3c72bf043fe0b289c9a5f4f445ebbb0aaf0e (diff) | |
download | packages_providers_ContactsProvider-1076c4946c230612c8eb56dbcdf2e3ca22a624e3.zip packages_providers_ContactsProvider-1076c4946c230612c8eb56dbcdf2e3ca22a624e3.tar.gz packages_providers_ContactsProvider-1076c4946c230612c8eb56dbcdf2e3ca22a624e3.tar.bz2 |
Enterprise quick contact 2/2
Now openQuickContact goes thorough DPM. When a lookup URI is build with
a lookup key returned by the enterprise lookup APIs for a corp contact, the
lookup key will have a special prefix. DPM checks it and launches QC on
the work profile, if the policy allows it.
Design doc: go/cp2-mnc-enterprise-dd
Bug 19546108
Change-Id: Iccba8254269180281af0154f4b9c20cbfff5c27d
-rw-r--r-- | src/com/android/providers/contacts/ContactsProvider2.java | 8 | ||||
-rw-r--r-- | tests/src/com/android/providers/contacts/ContactsProvider2Test.java | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/com/android/providers/contacts/ContactsProvider2.java b/src/com/android/providers/contacts/ContactsProvider2.java index 47dbf2e..d177651 100644 --- a/src/com/android/providers/contacts/ContactsProvider2.java +++ b/src/com/android/providers/contacts/ContactsProvider2.java @@ -6712,6 +6712,14 @@ public class ContactsProvider2 extends AbstractContactsProvider case Data.CUSTOM_RINGTONE: builder.add(null); break; + case Contacts.LOOKUP_KEY: + final String lookupKey = original.getString(originalColumnIndex); + if (TextUtils.isEmpty(lookupKey)) { + builder.add(null); + } else { + builder.add(Contacts.ENTERPRISE_CONTACT_LOOKUP_PREFIX + lookupKey); + } + break; default: if (outputColumnName.equals(contactIdColumnName)) { // This will be _id if it's PhoneLookup, contacts_id diff --git a/tests/src/com/android/providers/contacts/ContactsProvider2Test.java b/tests/src/com/android/providers/contacts/ContactsProvider2Test.java index 6a175ed..0e3c68b 100644 --- a/tests/src/com/android/providers/contacts/ContactsProvider2Test.java +++ b/tests/src/com/android/providers/contacts/ContactsProvider2Test.java @@ -2024,7 +2024,7 @@ public class ContactsProvider2Test extends BaseContactsProvider2Test { rewritten.moveToNext(); column = 0; assertEquals(1000000010L, rewritten.getLong(column++)); // With offset. - assertEquals("key", rewritten.getString(column++)); + assertEquals("c-key", rewritten.getString(column++)); assertEquals("name", rewritten.getString(column++)); assertEquals(123, rewritten.getInt(column++)); assertEquals(456, rewritten.getInt(column++)); |