IMS: Customize HD icon in CallCard for some carriers

Customize HD icon in CallCard for some carriers, it
indicates the current call is High Definition Audio.

Change-Id: I2339aa5b333a9415d17f092f3ef8647a79b0304a
CRs-Fixed: 1059806
diff --git a/InCallUI/res/drawable-hdpi/ic_hd2_24dp.png b/InCallUI/res/drawable-hdpi/ic_hd2_24dp.png
new file mode 100644
index 0000000..b4cbe6d
--- /dev/null
+++ b/InCallUI/res/drawable-hdpi/ic_hd2_24dp.png
Binary files differ
diff --git a/InCallUI/res/drawable-mdpi/ic_hd2_24dp.png b/InCallUI/res/drawable-mdpi/ic_hd2_24dp.png
new file mode 100644
index 0000000..f4bc997
--- /dev/null
+++ b/InCallUI/res/drawable-mdpi/ic_hd2_24dp.png
Binary files differ
diff --git a/InCallUI/res/drawable-xhdpi/ic_hd2_24dp.png b/InCallUI/res/drawable-xhdpi/ic_hd2_24dp.png
new file mode 100644
index 0000000..4ac0961
--- /dev/null
+++ b/InCallUI/res/drawable-xhdpi/ic_hd2_24dp.png
Binary files differ
diff --git a/InCallUI/res/drawable-xxhdpi/ic_hd2_24dp.png b/InCallUI/res/drawable-xxhdpi/ic_hd2_24dp.png
new file mode 100644
index 0000000..f1e6f1f
--- /dev/null
+++ b/InCallUI/res/drawable-xxhdpi/ic_hd2_24dp.png
Binary files differ
diff --git a/InCallUI/res/values-mcc460-mnc01/qticonfig.xml b/InCallUI/res/values-mcc460-mnc01/qticonfig.xml
new file mode 100644
index 0000000..5f789c5
--- /dev/null
+++ b/InCallUI/res/values-mcc460-mnc01/qticonfig.xml
@@ -0,0 +1,32 @@
+<!--
+  ~ Copyright (c) 2016, The Linux Foundation. All rights reserved.
+  ~
+  ~ Redistribution and use in source and binary forms, with or without
+  ~ modification, are permitted provided that the following conditions are
+  ~ met:
+  ~     * Redistributions of source code must retain the above copyright
+  ~       notice, this list of conditions and the following disclaimer.
+  ~     * Redistributions in binary form must reproduce the above
+  ~       copyright notice, this list of conditions and the following
+  ~       disclaimer in the documentation and/or other materials provided
+  ~       with the distribution.
+  ~     * Neither the name of The Linux Foundation nor the names of its
+  ~       contributors may be used to endorse or promote products derived
+  ~       from this software without specific prior written permission.
+  ~
+  ~ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+  ~ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+  ~ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+  ~ ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+  ~ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+  ~ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+  ~ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+  ~ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+  ~ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+  ~ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  ~ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  -->
+<resources>
+    <!-- Config to show/hide HD Icon2 -->
+    <bool name="config_show_hd2">true</bool>
+</resources>
diff --git a/InCallUI/res/values-mcc460-mnc06/qticonfig.xml b/InCallUI/res/values-mcc460-mnc06/qticonfig.xml
new file mode 100644
index 0000000..5f789c5
--- /dev/null
+++ b/InCallUI/res/values-mcc460-mnc06/qticonfig.xml
@@ -0,0 +1,32 @@
+<!--
+  ~ Copyright (c) 2016, The Linux Foundation. All rights reserved.
+  ~
+  ~ Redistribution and use in source and binary forms, with or without
+  ~ modification, are permitted provided that the following conditions are
+  ~ met:
+  ~     * Redistributions of source code must retain the above copyright
+  ~       notice, this list of conditions and the following disclaimer.
+  ~     * Redistributions in binary form must reproduce the above
+  ~       copyright notice, this list of conditions and the following
+  ~       disclaimer in the documentation and/or other materials provided
+  ~       with the distribution.
+  ~     * Neither the name of The Linux Foundation nor the names of its
+  ~       contributors may be used to endorse or promote products derived
+  ~       from this software without specific prior written permission.
+  ~
+  ~ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+  ~ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+  ~ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+  ~ ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+  ~ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+  ~ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+  ~ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+  ~ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+  ~ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+  ~ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  ~ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  -->
+<resources>
+    <!-- Config to show/hide HD Icon2 -->
+    <bool name="config_show_hd2">true</bool>
+</resources>
diff --git a/InCallUI/res/values-mcc460-mnc09/qticonfig.xml b/InCallUI/res/values-mcc460-mnc09/qticonfig.xml
new file mode 100644
index 0000000..5f789c5
--- /dev/null
+++ b/InCallUI/res/values-mcc460-mnc09/qticonfig.xml
@@ -0,0 +1,32 @@
+<!--
+  ~ Copyright (c) 2016, The Linux Foundation. All rights reserved.
+  ~
+  ~ Redistribution and use in source and binary forms, with or without
+  ~ modification, are permitted provided that the following conditions are
+  ~ met:
+  ~     * Redistributions of source code must retain the above copyright
+  ~       notice, this list of conditions and the following disclaimer.
+  ~     * Redistributions in binary form must reproduce the above
+  ~       copyright notice, this list of conditions and the following
+  ~       disclaimer in the documentation and/or other materials provided
+  ~       with the distribution.
+  ~     * Neither the name of The Linux Foundation nor the names of its
+  ~       contributors may be used to endorse or promote products derived
+  ~       from this software without specific prior written permission.
+  ~
+  ~ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+  ~ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+  ~ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+  ~ ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+  ~ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+  ~ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+  ~ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+  ~ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+  ~ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+  ~ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  ~ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  -->
+<resources>
+    <!-- Config to show/hide HD Icon2 -->
+    <bool name="config_show_hd2">true</bool>
+</resources>
diff --git a/InCallUI/res/values/qticonfig.xml b/InCallUI/res/values/qticonfig.xml
index 8483d84..67c50f3 100644
--- a/InCallUI/res/values/qticonfig.xml
+++ b/InCallUI/res/values/qticonfig.xml
@@ -54,4 +54,6 @@
     <bool name="add_participant_only_in_conference">false</bool>
     <!-- Config to if show preview before the receiver accepts a show me upgrade video call -->
     <bool name="config_enable_modify_call_preview">false</bool>
+    <!-- Config to show/hide HD Icon2 -->
+    <bool name="config_show_hd2">false</bool>
 </resources>
diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java
index c64f8c6..bbc95d3 100644
--- a/InCallUI/src/com/android/incallui/CallCardFragment.java
+++ b/InCallUI/src/com/android/incallui/CallCardFragment.java
@@ -45,6 +45,7 @@
 import android.provider.Settings;
 import android.telecom.DisconnectCause;
 import android.telephony.PhoneNumberUtils;
+import android.telephony.SubscriptionManager;
 import android.text.TextUtils;
 import android.text.format.DateUtils;
 import android.view.Gravity;
@@ -1357,6 +1358,11 @@
      */
     @Override
     public void showHdAudioIndicator(boolean visible) {
+        int subId = CallList.getInstance().getActiveSubId();
+        if (SubscriptionManager.getResourcesForSubId(getContext(), subId)
+                .getBoolean(R.bool.config_show_hd2)) {
+            mHdAudioIcon.setImageResource(R.drawable.ic_hd2_24dp);
+        }
         mHdAudioIcon.setVisibility(visible ? View.VISIBLE : View.GONE);
     }