summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authormaxwelb <maxwelb@google.com>2018-03-08 17:02:34 -0800
committerCopybara-Service <copybara-piper@google.com>2018-03-08 18:25:34 -0800
commit3a6d4d6cbf720689ed725cd351649e23072a7eee (patch)
tree58634c2a805e975775628b165ce787184c77fce4 /java
parent6df0bc4badbbe622a7f7696f9941a75a2360e876 (diff)
Add flag for filtering emergency calls from call log
Bug: 73368638 Test: CallLogAdapterTest PiperOrigin-RevId: 188414469 Change-Id: I7d7522c841a6b4054e2e387346973c597174ee87
Diffstat (limited to 'java')
-rw-r--r--java/com/android/dialer/app/calllog/CallLogAdapter.java11
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,