summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/searchfragment/README.md
diff options
context:
space:
mode:
authorEric Erfanian <erfanian@google.com>2017-08-31 06:57:16 -0700
committerEric Erfanian <erfanian@google.com>2017-08-31 16:13:53 +0000
commit2ca4318cc1ee57dda907ba2069bd61d162b1baef (patch)
treee282668a9587cf6c1ec7b604dea860400c75c6c7 /java/com/android/dialer/searchfragment/README.md
parent68038172793ee0e2ab3e2e56ddfbeb82879d1f58 (diff)
Update Dialer source to latest internal Google revision.
Previously, Android's Dialer app was developed in an internal Google source control system and only exported to public during AOSP drops. The Dialer team is now switching to a public development model similar to the telephony team. This CL represents all internal Google changes that were committed to Dialer between the public O release and today's tip of tree on internal master. This CL squashes those changes into a single commit. In subsequent changes, changes will be exported on a per-commit basis. Test: make, flash install, run Merged-In: I45270eaa8ce732d71a1bd84b08c7fa0e99af3160 Change-Id: I529aaeb88535b9533c0ae4ef4e6c1222d4e0f1c8 PiperOrigin-RevId: 167068436
Diffstat (limited to 'java/com/android/dialer/searchfragment/README.md')
-rw-r--r--java/com/android/dialer/searchfragment/README.md62
1 files changed, 62 insertions, 0 deletions
diff --git a/java/com/android/dialer/searchfragment/README.md b/java/com/android/dialer/searchfragment/README.md
new file mode 100644
index 000000000..b3b9135e5
--- /dev/null
+++ b/java/com/android/dialer/searchfragment/README.md
@@ -0,0 +1,62 @@
+# Dialer Search Ui
+
+searchfragment/ contains all code relevant to loading, rendering and filtering
+search results in both dialpad search and regular search.
+
+## Loading
+
+### On Device Contacts
+
+On device contacts loading happens in SearchContactsCursorLoader. It is used in
+conjunction with NewSearchFragment and Loader Callbacks to return a cursor from
+cp2 containing all of the relevant info needed to rendering.
+
+### Business Search
+
+// TODO(calderwoodra)
+
+### Google Directory Search
+
+// TODO(calderwoodra)
+
+## Rendering
+
+NewSearchFragment, SearchAdapter, SearchContactViewHolder and
+SearchCursorManager are used to render contact information. The fragment's
+recyclerview, adapter and viewholder work as expected like a normal recyclerview
+paradigm.
+
+The are three things to note about rendering:
+
+* There are three data sources rendered: On device contacts, business search
+ results and google directory results.
+* SearchContactsCursorLoader returns its cursor from cp2 and we filter/wrap it
+ with SearchContactCursor to render useful results (see below).
+* SearchCursorManager is used to coalesce all three data sources to help with
+ determining row count, row type and returning the correct data source for
+ each position.
+
+## Filtering
+
+On device contacts are filtered using SearchContactCursor. We wrap the cursor
+returned from SearchContactsCursorLoader in NewSearchFragment#onLoadFinished in
+order to abstract away the filtering logic from the recyclerview adapter and
+viewholders.
+
+SearchContactCursor applies filtering in SearchContactCursor#filter to remove
+duplicate phone numbers returned from cp2 and phone numbers that do not match
+the given search query.
+
+Filtering methods used are:
+
+* T9/dialpad search methods
+ * Initial match (957 matches [W]illiam [J]ohn [S]mith)
+ * Number + name match (1800946 matches [1800-Win]-A-Prize)
+* Numeric/dialpad search methods
+ * Simple number match (510333 matches [510-333]-7596)
+ * Country-code agnostic matching for E164 normalized numbers (9177 matches
+ +65[9177]6930)
+ * Country-code agnostic matching (510333 matches 1-[510-333]-7596)
+ * Area-code agnostic matching (333 matches 510-[333]-7596)
+* Name/keyboard search methods:
+ * Simple name match (564 matches [Joh]n)