diff options
author | Andrew Lee <anwlee@google.com> | 2015-03-20 21:05:45 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-03-20 21:05:50 +0000 |
commit | f181b45d59f114c72e71053f9390f3b83034d881 (patch) | |
tree | 78aba6a20e180eea1ca426cb55c114263eb77fa8 | |
parent | beb1dfe1884d8707b2c2e32125098a87cce794fb (diff) | |
parent | 5b8a5cb6b8e15913bb6faa8f44b4b69a62eff85e (diff) |
Merge "Cleanup logic for showing/hiding shortcuts."
3 files changed, 4 insertions, 4 deletions
diff --git a/src/com/android/dialer/list/RegularSearchListAdapter.java b/src/com/android/dialer/list/RegularSearchListAdapter.java index 722dc2ed6..3c55bc012 100644 --- a/src/com/android/dialer/list/RegularSearchListAdapter.java +++ b/src/com/android/dialer/list/RegularSearchListAdapter.java @@ -33,6 +33,8 @@ public class RegularSearchListAdapter extends DialerPhoneNumberListAdapter { public RegularSearchListAdapter(Context context) { super(context); + setShortcutEnabled(SHORTCUT_CREATE_NEW_CONTACT, false); + setShortcutEnabled(SHORTCUT_ADD_TO_EXISTING_CONTACT, false); } public CachedContactInfo getContactInfo( @@ -69,8 +71,7 @@ public class RegularSearchListAdapter extends DialerPhoneNumberListAdapter { final boolean showNumberShortcuts = !TextUtils.isEmpty(getFormattedQueryString()); boolean changed = false; changed |= setShortcutEnabled(SHORTCUT_DIRECT_CALL, showNumberShortcuts); - changed |= setShortcutEnabled(SHORTCUT_CREATE_NEW_CONTACT, showNumberShortcuts); - changed |= setShortcutEnabled(SHORTCUT_ADD_TO_EXISTING_CONTACT, showNumberShortcuts); + changed |= setShortcutEnabled(SHORTCUT_SEND_SMS_MESSAGE, showNumberShortcuts); changed |= setShortcutEnabled(SHORTCUT_MAKE_VIDEO_CALL, showNumberShortcuts && CallUtil.isVideoEnabled(getContext())); if (changed) { diff --git a/src/com/android/dialer/list/SmartDialNumberListAdapter.java b/src/com/android/dialer/list/SmartDialNumberListAdapter.java index 22ee92df2..fe27a25ab 100644 --- a/src/com/android/dialer/list/SmartDialNumberListAdapter.java +++ b/src/com/android/dialer/list/SmartDialNumberListAdapter.java @@ -46,6 +46,7 @@ public class SmartDialNumberListAdapter extends DialerPhoneNumberListAdapter { public SmartDialNumberListAdapter(Context context) { super(context); mNameMatcher = new SmartDialNameMatcher("", SmartDialPrefix.getMap()); + setShortcutEnabled(SmartDialNumberListAdapter.SHORTCUT_DIRECT_CALL, false); if (DEBUG) { Log.v(TAG, "Constructing List Adapter"); diff --git a/src/com/android/dialer/list/SmartDialSearchFragment.java b/src/com/android/dialer/list/SmartDialSearchFragment.java index 6c521147e..082bc4360 100644 --- a/src/com/android/dialer/list/SmartDialSearchFragment.java +++ b/src/com/android/dialer/list/SmartDialSearchFragment.java @@ -38,8 +38,6 @@ public class SmartDialSearchFragment extends SearchFragment { SmartDialNumberListAdapter adapter = new SmartDialNumberListAdapter(getActivity()); adapter.setUseCallableUri(super.usesCallableUri()); adapter.setQuickContactEnabled(true); - // Disable the direct call shortcut. The call button will already be showing. - adapter.setShortcutEnabled(SmartDialNumberListAdapter.SHORTCUT_DIRECT_CALL, false); // Set adapter's query string to restore previous instance state. adapter.setQueryString(getQueryString()); return adapter; |