From dcefa65cf08671b748d549a2cdd169c5d2530415 Mon Sep 17 00:00:00 2001 From: calderwoodra Date: Mon, 14 Aug 2017 12:07:47 -0700 Subject: Added ability to place RCS, Duo and IMS calls from new search fragment. Bug: 37209462 Test: SearchAdapterTest + existing tests PiperOrigin-RevId: 165210817 Change-Id: I9fb78cf7d964b97e6e95c01437780aa66405f019 --- .../dialer/searchfragment/common/Projections.java | 6 ++- .../searchfragment/common/RowClickListener.java | 43 ++++++++++++++++++++++ 2 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 java/com/android/dialer/searchfragment/common/RowClickListener.java (limited to 'java/com/android/dialer/searchfragment/common') diff --git a/java/com/android/dialer/searchfragment/common/Projections.java b/java/com/android/dialer/searchfragment/common/Projections.java index 37e20d195..078c3e5e6 100644 --- a/java/com/android/dialer/searchfragment/common/Projections.java +++ b/java/com/android/dialer/searchfragment/common/Projections.java @@ -30,9 +30,10 @@ public class Projections { public static final int PHONE_PHOTO_URI = 6; public static final int PHONE_LOOKUP_KEY = 7; public static final int PHONE_CARRIER_PRESENCE = 8; + public static final int PHONE_CONTACT_ID = 9; @SuppressWarnings("unused") - public static final int PHONE_SORT_KEY = 9; + public static final int PHONE_SORT_KEY = 10; public static final String[] PHONE_PROJECTION = new String[] { @@ -45,6 +46,7 @@ public class Projections { Phone.PHOTO_THUMBNAIL_URI, // 6 Phone.LOOKUP_KEY, // 7 Phone.CARRIER_PRESENCE, // 8 - Phone.SORT_KEY_PRIMARY // 9 + Phone.CONTACT_ID, // 9 + Phone.SORT_KEY_PRIMARY // 10 }; } diff --git a/java/com/android/dialer/searchfragment/common/RowClickListener.java b/java/com/android/dialer/searchfragment/common/RowClickListener.java new file mode 100644 index 000000000..e82f3f7bb --- /dev/null +++ b/java/com/android/dialer/searchfragment/common/RowClickListener.java @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ + +package com.android.dialer.searchfragment.common; + +import com.android.dialer.dialercontact.DialerContact; + +/** Interface of possible actions that can be performed by search elements. */ +public interface RowClickListener { + + /** + * Places a traditional voice call. + * + * @param ranking position in the list relative to the other elements + */ + void placeVoiceCall(String phoneNumber, int ranking); + + /** + * Places an IMS video call. + * + * @param ranking position in the list relative to the other elements + */ + void placeVideoCall(String phoneNumber, int ranking); + + /** Places a Duo video call. */ + void placeDuoCall(String phoneNumber); + + /** Opens the enriched calling/call composer interface. */ + void openCallAndShare(DialerContact dialerContact); +} -- cgit v1.2.3