diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-03-09 02:48:39 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-03-09 02:48:39 +0000 |
commit | 31fec1d4fbe878d9b28685b8b811f1488edff443 (patch) | |
tree | 58634c2a805e975775628b165ce787184c77fce4 /java | |
parent | 6df0bc4badbbe622a7f7696f9941a75a2360e876 (diff) | |
parent | 3a6d4d6cbf720689ed725cd351649e23072a7eee (diff) |
Merge "Add flag for filtering emergency calls from call log"
Diffstat (limited to 'java')
-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, |