Dialer: Add control for the call duration display

Add config to display/hide call duration view in call

detail activity by MCC/MNC.

Change-Id: Idfb29c5b8f7d1f27886e08879a89f422dc2ff687
CRs-Fixed: 943296
diff --git a/InCallUI/res/values-mcc460-mnc00/qticonfig.xml b/InCallUI/res/values-mcc460-mnc00/qticonfig.xml
index aed87f3..9adbd11 100644
--- a/InCallUI/res/values-mcc460-mnc00/qticonfig.xml
+++ b/InCallUI/res/values-mcc460-mnc00/qticonfig.xml
@@ -33,4 +33,6 @@
     <bool name="config_call_session_event_toast">false</bool>
     <!-- Config to show/hide data usage toast -->
     <bool name="config_display_data_usage_toast">false</bool>
+    <!-- Config to show/hide call duration in call detail -->
+    <bool name="call_duration_enabled">false</bool>
 </resources>
diff --git a/InCallUI/res/values-mcc460-mnc02/qticonfig.xml b/InCallUI/res/values-mcc460-mnc02/qticonfig.xml
index b23505a..6115c7b 100644
--- a/InCallUI/res/values-mcc460-mnc02/qticonfig.xml
+++ b/InCallUI/res/values-mcc460-mnc02/qticonfig.xml
@@ -33,4 +33,6 @@
     <bool name="config_call_session_event_toast">false</bool>
     <!-- Config to show/hide data usage toast -->
     <bool name="config_display_data_usage_toast">false</bool>
+    <!-- Config to show/hide call duration in call detail -->
+    <bool name="call_duration_enabled">false</bool>
 </resources>
diff --git a/InCallUI/res/values-mcc460-mnc07/qticonfig.xml b/InCallUI/res/values-mcc460-mnc07/qticonfig.xml
index aed87f3..9adbd11 100644
--- a/InCallUI/res/values-mcc460-mnc07/qticonfig.xml
+++ b/InCallUI/res/values-mcc460-mnc07/qticonfig.xml
@@ -33,4 +33,6 @@
     <bool name="config_call_session_event_toast">false</bool>
     <!-- Config to show/hide data usage toast -->
     <bool name="config_display_data_usage_toast">false</bool>
+    <!-- Config to show/hide call duration in call detail -->
+    <bool name="call_duration_enabled">false</bool>
 </resources>
diff --git a/InCallUI/res/values-mcc460-mnc08/qticonfig.xml b/InCallUI/res/values-mcc460-mnc08/qticonfig.xml
index aed87f3..9adbd11 100644
--- a/InCallUI/res/values-mcc460-mnc08/qticonfig.xml
+++ b/InCallUI/res/values-mcc460-mnc08/qticonfig.xml
@@ -33,4 +33,6 @@
     <bool name="config_call_session_event_toast">false</bool>
     <!-- Config to show/hide data usage toast -->
     <bool name="config_display_data_usage_toast">false</bool>
+    <!-- Config to show/hide call duration in call detail -->
+    <bool name="call_duration_enabled">false</bool>
 </resources>
diff --git a/InCallUI/res/values/qticonfig.xml b/InCallUI/res/values/qticonfig.xml
index 966e563..557fa90 100644
--- a/InCallUI/res/values/qticonfig.xml
+++ b/InCallUI/res/values/qticonfig.xml
@@ -40,4 +40,6 @@
     default value is false, true is for LatamOpenAMX
     -->
     <bool name="def_incallui_clearcode_enabled">false</bool>
+    <!-- Config to show/hide call duration in call detail -->
+    <bool name="call_duration_enabled">true</bool>
 </resources>
diff --git a/src/com/android/dialer/calllog/CallDetailHistoryAdapter.java b/src/com/android/dialer/calllog/CallDetailHistoryAdapter.java
index ac56332..8af66af 100644
--- a/src/com/android/dialer/calllog/CallDetailHistoryAdapter.java
+++ b/src/com/android/dialer/calllog/CallDetailHistoryAdapter.java
@@ -118,7 +118,10 @@
                 DateUtils.FORMAT_SHOW_WEEKDAY | DateUtils.FORMAT_SHOW_YEAR);
         dateView.setText(dateValue);
         // Set the duration
-        if (Calls.VOICEMAIL_TYPE == callType || CallTypeHelper.isMissedCallType(callType)) {
+        boolean callDurationEnabled = mContext.getResources()
+                .getBoolean(R.bool.call_duration_enabled);
+        if (Calls.VOICEMAIL_TYPE == callType || CallTypeHelper.isMissedCallType(callType) ||
+                !callDurationEnabled) {
             durationView.setVisibility(View.GONE);
         } else {
             durationView.setVisibility(View.VISIBLE);