Loading src/com/android/dialer/list/DialerPhoneNumberListAdapter.java +6 −1 Original line number Diff line number Diff line Loading @@ -159,8 +159,13 @@ public class DialerPhoneNumberListAdapter extends PhoneNumberListAdapter { v.setAdjustSelectionBoundsEnabled(false); } public void setShortcutEnabled(int shortcutType, boolean visible) { /** * @return True if the shortcut state (disabled vs enabled) was changed by this operation */ public boolean setShortcutEnabled(int shortcutType, boolean visible) { final boolean changed = mShortcutEnabled[shortcutType] != visible; mShortcutEnabled[shortcutType] = visible; return changed; } public String getFormattedQueryString() { Loading src/com/android/dialer/list/RegularSearchListAdapter.java +7 −3 Original line number Diff line number Diff line Loading @@ -69,13 +69,17 @@ public class RegularSearchListAdapter extends DialerPhoneNumberListAdapter { @Override public void setQueryString(String queryString) { final boolean showNumberShortcuts = !TextUtils.isEmpty(getFormattedQueryString()); setShortcutEnabled(SHORTCUT_DIRECT_CALL, showNumberShortcuts); boolean changed = false; changed |= setShortcutEnabled(SHORTCUT_DIRECT_CALL, showNumberShortcuts); // Either one of the add contacts options should be enabled. If the user entered // a dialable number, then clicking add to contact should add it as a number. // Otherwise, it should add it to a new contact as a name. setShortcutEnabled(SHORTCUT_ADD_NUMBER_TO_CONTACTS, showNumberShortcuts); setShortcutEnabled(SHORTCUT_MAKE_VIDEO_CALL, changed |= setShortcutEnabled(SHORTCUT_ADD_NUMBER_TO_CONTACTS, showNumberShortcuts); changed |= setShortcutEnabled(SHORTCUT_MAKE_VIDEO_CALL, showNumberShortcuts && CallUtil.isVideoEnabled(getContext())); if (changed) { notifyDataSetChanged(); } super.setQueryString(queryString); } } src/com/android/dialer/list/SmartDialNumberListAdapter.java +6 −2 Original line number Diff line number Diff line Loading @@ -118,9 +118,13 @@ public class SmartDialNumberListAdapter extends DialerPhoneNumberListAdapter { @Override public void setQueryString(String queryString) { final boolean showNumberShortcuts = !TextUtils.isEmpty(getFormattedQueryString()); setShortcutEnabled(SHORTCUT_ADD_NUMBER_TO_CONTACTS, showNumberShortcuts); setShortcutEnabled(SHORTCUT_MAKE_VIDEO_CALL, boolean changed = false; changed |= setShortcutEnabled(SHORTCUT_ADD_NUMBER_TO_CONTACTS, showNumberShortcuts); changed |= setShortcutEnabled(SHORTCUT_MAKE_VIDEO_CALL, showNumberShortcuts && CallUtil.isVideoEnabled(getContext())); if (changed) { notifyDataSetChanged(); } super.setQueryString(queryString); } } Loading
src/com/android/dialer/list/DialerPhoneNumberListAdapter.java +6 −1 Original line number Diff line number Diff line Loading @@ -159,8 +159,13 @@ public class DialerPhoneNumberListAdapter extends PhoneNumberListAdapter { v.setAdjustSelectionBoundsEnabled(false); } public void setShortcutEnabled(int shortcutType, boolean visible) { /** * @return True if the shortcut state (disabled vs enabled) was changed by this operation */ public boolean setShortcutEnabled(int shortcutType, boolean visible) { final boolean changed = mShortcutEnabled[shortcutType] != visible; mShortcutEnabled[shortcutType] = visible; return changed; } public String getFormattedQueryString() { Loading
src/com/android/dialer/list/RegularSearchListAdapter.java +7 −3 Original line number Diff line number Diff line Loading @@ -69,13 +69,17 @@ public class RegularSearchListAdapter extends DialerPhoneNumberListAdapter { @Override public void setQueryString(String queryString) { final boolean showNumberShortcuts = !TextUtils.isEmpty(getFormattedQueryString()); setShortcutEnabled(SHORTCUT_DIRECT_CALL, showNumberShortcuts); boolean changed = false; changed |= setShortcutEnabled(SHORTCUT_DIRECT_CALL, showNumberShortcuts); // Either one of the add contacts options should be enabled. If the user entered // a dialable number, then clicking add to contact should add it as a number. // Otherwise, it should add it to a new contact as a name. setShortcutEnabled(SHORTCUT_ADD_NUMBER_TO_CONTACTS, showNumberShortcuts); setShortcutEnabled(SHORTCUT_MAKE_VIDEO_CALL, changed |= setShortcutEnabled(SHORTCUT_ADD_NUMBER_TO_CONTACTS, showNumberShortcuts); changed |= setShortcutEnabled(SHORTCUT_MAKE_VIDEO_CALL, showNumberShortcuts && CallUtil.isVideoEnabled(getContext())); if (changed) { notifyDataSetChanged(); } super.setQueryString(queryString); } }
src/com/android/dialer/list/SmartDialNumberListAdapter.java +6 −2 Original line number Diff line number Diff line Loading @@ -118,9 +118,13 @@ public class SmartDialNumberListAdapter extends DialerPhoneNumberListAdapter { @Override public void setQueryString(String queryString) { final boolean showNumberShortcuts = !TextUtils.isEmpty(getFormattedQueryString()); setShortcutEnabled(SHORTCUT_ADD_NUMBER_TO_CONTACTS, showNumberShortcuts); setShortcutEnabled(SHORTCUT_MAKE_VIDEO_CALL, boolean changed = false; changed |= setShortcutEnabled(SHORTCUT_ADD_NUMBER_TO_CONTACTS, showNumberShortcuts); changed |= setShortcutEnabled(SHORTCUT_MAKE_VIDEO_CALL, showNumberShortcuts && CallUtil.isVideoEnabled(getContext())); if (changed) { notifyDataSetChanged(); } super.setQueryString(queryString); } }