diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-09-19 21:55:42 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-09-19 21:55:42 +0000 |
commit | 15c5ccfc3a76c89b047722b398e63889d900ec5e (patch) | |
tree | ccc4ba1be4af03ced6f837b0dc86bb9800ce9370 /java/com/android/dialer/searchfragment/list/NewSearchFragment.java | |
parent | 06d4df10f100b9bbfcf119aef376770eeb6eb82c (diff) | |
parent | 791f820f5108b3ea914690145ef261d6c01bf41a (diff) |
Merge changes I3f26d915,I59500877,Ia08ce56f
* changes:
Perform remote reachability query if caller is not in contacts
Only enable voicemail transcription on android O and later
Removed zero suggest from dialpad search in new search fragment.
Diffstat (limited to 'java/com/android/dialer/searchfragment/list/NewSearchFragment.java')
-rw-r--r-- | java/com/android/dialer/searchfragment/list/NewSearchFragment.java | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/java/com/android/dialer/searchfragment/list/NewSearchFragment.java b/java/com/android/dialer/searchfragment/list/NewSearchFragment.java index 036d53fb5..3cf8fb5b9 100644 --- a/java/com/android/dialer/searchfragment/list/NewSearchFragment.java +++ b/java/com/android/dialer/searchfragment/list/NewSearchFragment.java @@ -73,6 +73,8 @@ public final class NewSearchFragment extends Fragment // updates so they are bundled together private static final int ENRICHED_CALLING_CAPABILITIES_UPDATED_DELAY = 400; + private static final String KEY_SHOW_ZERO_SUGGEST = "use_zero_suggest"; + @VisibleForTesting public static final int READ_CONTACTS_PERMISSION_REQUEST_CODE = 1; private static final int CONTACTS_LOADER_ID = 0; @@ -99,6 +101,14 @@ public final class NewSearchFragment extends Fragment private Runnable updatePositionRunnable; + public static NewSearchFragment newInstance(boolean showZeroSuggest) { + NewSearchFragment fragment = new NewSearchFragment(); + Bundle args = new Bundle(); + args.putBoolean(KEY_SHOW_ZERO_SUGGEST, showZeroSuggest); + fragment.setArguments(args); + return fragment; + } + @Nullable @Override public View onCreateView( @@ -107,6 +117,7 @@ public final class NewSearchFragment extends Fragment adapter = new SearchAdapter(getActivity(), new SearchCursorManager()); adapter.setCallInitiationType(callInitiationType); adapter.setSearchActions(getActions()); + adapter.setZeroSuggestVisible(getArguments().getBoolean(KEY_SHOW_ZERO_SUGGEST)); emptyContentView = view.findViewById(R.id.empty_view); recyclerView = view.findViewById(R.id.recycler_view); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); @@ -212,6 +223,7 @@ public final class NewSearchFragment extends Fragment adapter.setQuery(query); adapter.setCallInitiationType(callInitiationType); adapter.setSearchActions(getActions()); + adapter.setZeroSuggestVisible(isRegularSearch()); loadNearbyPlacesCursor(); loadRemoteContactsCursors(); } @@ -354,9 +366,7 @@ public final class NewSearchFragment extends Fragment * the list of supported actions, see {@link SearchActionViewHolder.Action}. */ private List<Integer> getActions() { - if (TextUtils.isEmpty(query) - || query.length() == 1 - || callInitiationType == CallInitiationType.Type.REGULAR_SEARCH) { + if (TextUtils.isEmpty(query) || query.length() == 1 || isRegularSearch()) { return Collections.emptyList(); } @@ -369,4 +379,8 @@ public final class NewSearchFragment extends Fragment } return actions; } + + private boolean isRegularSearch() { + return callInitiationType == CallInitiationType.Type.REGULAR_SEARCH; + } } |