diff options
Diffstat (limited to 'java/com/android/dialer/app')
3 files changed, 21 insertions, 10 deletions
diff --git a/java/com/android/dialer/app/DialtactsActivity.java b/java/com/android/dialer/app/DialtactsActivity.java index 1a549abf3..eb95a4ee4 100644 --- a/java/com/android/dialer/app/DialtactsActivity.java +++ b/java/com/android/dialer/app/DialtactsActivity.java @@ -1400,7 +1400,7 @@ public class DialtactsActivity extends TransactionSafeActivity mNewSearchFragment.setRawNumber(query); } final String normalizedQuery = - SmartDialNameMatcher.normalizeNumber(query, SmartDialNameMatcher.LATIN_SMART_DIAL_MAP); + SmartDialNameMatcher.normalizeNumber(/* context = */ this, query); if (!TextUtils.equals(mSearchView.getText(), normalizedQuery)) { if (DEBUG) { diff --git a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java index 2baf117dc..15c4b5850 100644 --- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java +++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java @@ -691,15 +691,25 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder videoCallButtonView.setTag(IntentProvider.getDuoVideoIntentProvider(number)); videoCallButtonView.setVisibility(View.VISIBLE); } else if (duo.isActivated(mContext) && !identifiedSpamCall) { - inviteVideoButtonView.setTag(IntentProvider.getDuoInviteIntentProvider(number)); - inviteVideoButtonView.setVisibility(View.VISIBLE); + if (ConfigProviderBindings.get(mContext) + .getBoolean("enable_call_log_duo_invite_button", false)) { + inviteVideoButtonView.setTag(IntentProvider.getDuoInviteIntentProvider(number)); + inviteVideoButtonView.setVisibility(View.VISIBLE); + } } else if (duo.isEnabled(mContext) && !identifiedSpamCall) { if (!duo.isInstalled(mContext)) { - setUpVideoButtonView.setTag(IntentProvider.getInstallDuoIntentProvider()); + if (ConfigProviderBindings.get(mContext) + .getBoolean("enable_call_log_install_duo_button", false)) { + setUpVideoButtonView.setTag(IntentProvider.getInstallDuoIntentProvider()); + setUpVideoButtonView.setVisibility(View.VISIBLE); + } } else { - setUpVideoButtonView.setTag(IntentProvider.getSetUpDuoIntentProvider()); + if (ConfigProviderBindings.get(mContext) + .getBoolean("enable_call_log_activate_duo_button", false)) { + setUpVideoButtonView.setTag(IntentProvider.getSetUpDuoIntentProvider()); + setUpVideoButtonView.setVisibility(View.VISIBLE); + } } - setUpVideoButtonView.setVisibility(View.VISIBLE); } break; default: diff --git a/java/com/android/dialer/app/list/SmartDialNumberListAdapter.java b/java/com/android/dialer/app/list/SmartDialNumberListAdapter.java index 3b00c7643..5b48ccfd0 100644 --- a/java/com/android/dialer/app/list/SmartDialNumberListAdapter.java +++ b/java/com/android/dialer/app/list/SmartDialNumberListAdapter.java @@ -25,7 +25,6 @@ import com.android.dialer.common.LogUtil; import com.android.dialer.dialpadview.SmartDialCursorLoader; import com.android.dialer.smartdial.SmartDialMatchPosition; import com.android.dialer.smartdial.SmartDialNameMatcher; -import com.android.dialer.smartdial.SmartDialPrefix; import com.android.dialer.util.CallUtil; import java.util.ArrayList; @@ -35,11 +34,13 @@ public class SmartDialNumberListAdapter extends DialerPhoneNumberListAdapter { private static final String TAG = SmartDialNumberListAdapter.class.getSimpleName(); private static final boolean DEBUG = false; + private final Context mContext; @NonNull private final SmartDialNameMatcher mNameMatcher; public SmartDialNumberListAdapter(Context context) { super(context); - mNameMatcher = new SmartDialNameMatcher("", SmartDialPrefix.getMap()); + mContext = context; + mNameMatcher = new SmartDialNameMatcher(""); setShortcutEnabled(SmartDialNumberListAdapter.SHORTCUT_DIRECT_CALL, false); if (DEBUG) { @@ -72,7 +73,7 @@ public class SmartDialNumberListAdapter extends DialerPhoneNumberListAdapter { protected void setHighlight(ContactListItemView view, Cursor cursor) { view.clearHighlightSequences(); - if (mNameMatcher.matches(cursor.getString(PhoneQuery.DISPLAY_NAME))) { + if (mNameMatcher.matches(mContext, cursor.getString(PhoneQuery.DISPLAY_NAME))) { final ArrayList<SmartDialMatchPosition> nameMatches = mNameMatcher.getMatchPositions(); for (SmartDialMatchPosition match : nameMatches) { view.addNameHighlightSequence(match.start, match.end); @@ -89,7 +90,7 @@ public class SmartDialNumberListAdapter extends DialerPhoneNumberListAdapter { } final SmartDialMatchPosition numberMatch = - mNameMatcher.matchesNumber(cursor.getString(PhoneQuery.PHONE_NUMBER)); + mNameMatcher.matchesNumber(mContext, cursor.getString(PhoneQuery.PHONE_NUMBER)); if (numberMatch != null) { view.addNumberHighlightSequence(numberMatch.start, numberMatch.end); } |