diff options
-rw-r--r-- | java/com/android/dialer/app/calllog/CallLogAdapter.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogAdapter.java b/java/com/android/dialer/app/calllog/CallLogAdapter.java index 4b860fea1..7f8c889de 100644 --- a/java/com/android/dialer/app/calllog/CallLogAdapter.java +++ b/java/com/android/dialer/app/calllog/CallLogAdapter.java @@ -119,6 +119,8 @@ public class CallLogAdapter extends GroupingListAdapter public static final String ENABLE_CALL_LOG_MULTI_SELECT = "enable_call_log_multiselect"; public static final boolean ENABLE_CALL_LOG_MULTI_SELECT_FLAG = true; + @VisibleForTesting static final String FILTER_EMERGENCY_CALLS_FLAG = "filter_emergency_calls"; + protected final Activity activity; protected final VoicemailPlaybackPresenter voicemailPlaybackPresenter; /** Cache for repeated requests to Telecom/Telephony. */ @@ -840,7 +842,7 @@ public class CallLogAdapter extends GroupingListAdapter } private boolean isHiddenRow(@Nullable String number, long rowId) { - if (number != null && PhoneNumberUtils.isEmergencyNumber(number)) { + if (isHideableEmergencyNumberRow(number)) { return true; } if (hiddenRowIds.contains(rowId)) { @@ -849,6 +851,13 @@ public class CallLogAdapter extends GroupingListAdapter return false; } + private boolean isHideableEmergencyNumberRow(@Nullable String number) { + if (!ConfigProviderBindings.get(activity).getBoolean(FILTER_EMERGENCY_CALLS_FLAG, false)) { + return false; + } + return number != null && PhoneNumberUtils.isEmergencyNumber(number); + } + private void loadAndRender( final CallLogListItemViewHolder viewHolder, final long rowId, |