Merge "Mis Telecomm API changes - telephony"
diff --git a/res/values/strings.xml b/res/values/strings.xml
index aa60664..4caeef2 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1138,102 +1138,6 @@
     <!-- Settings summary string for the "Respond via SMS" feature. [CHAR LIMIT=40] -->
     <string name="respond_via_sms_setting_summary"></string>
 
-    <!-- String describing the image on ImageButton one
-
-         Note: AccessibilityServices use this attribute to announce what the view represents.
-               This is especially valuable for views without textual representation like ImageView.
-         [CHAR LIMIT=NONE]
-    -->
-    <string name="description_image_button_one">one</string>
-
-    <!-- String describing the image on ImageButton two
-
-         Note: AccessibilityServices use this attribute to announce what the view represents.
-               This is especially valuable for views without textual representation like ImageView.
-         [CHAR LIMIT=NONE]
-    -->
-    <string name="description_image_button_two">two</string>
-
-    <!-- String describing the image on ImageButton three
-
-         Note: AccessibilityServices use this attribute to announce what the view represents.
-               This is especially valuable for views without textual representation like ImageView.
-         [CHAR LIMIT=NONE]
-    -->
-    <string name="description_image_button_three">three</string>
-
-    <!-- String describing the image on ImageButton four
-
-         Note: AccessibilityServices use this attribute to announce what the view represents.
-               This is especially valuable for views without textual representation like ImageView.
-         [CHAR LIMIT=NONE]
-    -->
-    <string name="description_image_button_four">four</string>
-
-    <!-- String describing the image on ImageButton five
-
-         Note: AccessibilityServices use this attribute to announce what the view represents.
-               This is especially valuable for views without textual representation like ImageView.
-         [CHAR LIMIT=NONE]
-    -->
-    <string name="description_image_button_five">five</string>
-
-    <!-- String describing the image on ImageButton six
-
-         Note: AccessibilityServices use this attribute to announce what the view represents.
-               This is especially valuable for views without textual representation like ImageView.
-         [CHAR LIMIT=NONE]
-    -->
-    <string name="description_image_button_six">six</string>
-
-    <!-- String describing the image on ImageButton seven
-
-         Note: AccessibilityServices use this attribute to announce what the view represents.
-               This is especially valuable for views without textual representation like ImageView.
-         [CHAR LIMIT=NONE]
-    -->
-    <string name="description_image_button_seven">seven</string>
-
-    <!-- String describing the image on ImageButton eight
-
-         Note: AccessibilityServices use this attribute to announce what the view represents.
-               This is especially valuable for views without textual representation like ImageView.
-         [CHAR LIMIT=NONE]
-    -->
-    <string name="description_image_button_eight">eight</string>
-
-    <!-- String describing the image on ImageButton nine
-
-         Note: AccessibilityServices use this attribute to announce what the view represents.
-               This is especially valuable for views without textual representation like ImageView.
-         [CHAR LIMIT=NONE]
-    -->
-    <string name="description_image_button_nine">nine</string>
-
-    <!-- String describing the image on ImageButton star
-
-         Note: AccessibilityServices use this attribute to announce what the view represents.
-               This is especially valuable for views without textual representation like ImageView.
-         [CHAR LIMIT=NONE]
-    -->
-    <string name="description_image_button_star">star</string>
-
-    <!-- String describing the image on ImageButton zero
-
-         Note: AccessibilityServices use this attribute to announce what the view represents.
-               This is especially valuable for views without textual representation like ImageView.
-         [CHAR LIMIT=NONE]
-    -->
-    <string name="description_image_button_zero">zero</string>
-
-    <!-- String describing the image on ImageButton pound
-
-         Note: AccessibilityServices use this attribute to announce what the view represents.
-               This is especially valuable for views without textual representation like ImageView.
-         [CHAR LIMIT=NONE]
-    -->
-    <string name="description_image_button_pound">pound</string>
-
     <!-- String describing the Dial ImageButton
 
          Used by AccessibilityService to announce the purpose of the button.
@@ -1241,20 +1145,6 @@
     -->
     <string name="description_dial_button">dial</string>
 
-    <!-- String describing the Delete/Backspace ImageButton
-
-         Used by AccessibilityService to announce the purpose of the button.
-         [CHAR LIMIT=NONE]
-    -->
-    <string name="description_delete_button">backspace</string>
-
-    <!-- Description of the answer target in the Slide unlock screen of Phone. [CHAR LIMIT=NONE] -->
-    <string name="description_target_answer">Answer</string>
-    <!-- Description of the send_sms target in the Slide unlock screen of Phone. [CHAR LIMIT=NONE] -->
-    <string name="description_target_send_sms">Send SMS</string>
-    <!-- Description of the decline on target in the Slide unlock screen. [CHAR LIMIT=NONE] -->
-    <string name="description_target_decline">Decline</string>
-
     <!-- Dialog title for the vibration settings for voicemail notifications [CHAR LIMIT=40] -->
     <string name="voicemail_notification_vibrate_when_title" msgid="8731372580674292759">Vibrate</string>
     <!-- Dialog title for the vibration settings for voice mail notifications [CHAR LIMIT=40]-->
@@ -1306,7 +1196,31 @@
          Do not translate. -->
     <string name="call_settings_title_font_family">sans-serif-light</string>
 
+    <!-- Title of the dialog to choose WiFi calling. -->
+    <string name="choose_wifi_for_call_msg">Use Wi-Fi to place call?</string>
+
+    <!-- Title for button to use WiFi calling. -->
+    <string name="choose_wifi_for_call_yes">Yes</string>
+
+    <!-- Title for button to not use WiFi calling. -->
+    <string name="choose_wifi_for_call_no">No</string>
+
     <!-- Label for PSTN connection service. -->
     <string name="pstn_connection_service_label">Built-in SIM cards</string>
 
+    <!-- Label for enabling video calling. -->
+    <string name="enable_video_calling_title">Turn on video calling</string>
+
+    <!-- Message for dialog shown when the user tries to turn on video calling but enhanced 4G LTE
+         is disabled. -->
+    <string name="enable_video_calling_dialog_msg">
+        To turn on video calling, you need to enable Enhanced 4G LTE Mode in system settings.
+    </string>
+
+    <!-- Label for action button in dialog which opens mobile network settings, for video calling
+         setting. -->
+    <string name="enable_video_calling_dialog_settings">Network settings</string>
+
+    <!-- Label for close button in dialog, for video calling setting. -->
+    <string name="enable_video_calling_dialog_close">Close</string>
 </resources>
diff --git a/res/xml/call_feature_setting.xml b/res/xml/call_feature_setting.xml
index f8dd2f1..6c1b570 100644
--- a/res/xml/call_feature_setting.xml
+++ b/res/xml/call_feature_setting.xml
@@ -168,4 +168,10 @@
             android:targetPackage="com.android.phone"
             android:targetClass="com.android.phone.CdmaCallOptions"/>
     </PreferenceScreen>
+
+    <CheckBoxPreference
+        android:key="button_enable_video_calling"
+        android:title="@string/enable_video_calling_title"
+        android:persistent="true"
+        android:defaultValue="true" />
 </PreferenceScreen>
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 057f8ad..70847fe 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -1689,4 +1689,24 @@
         }
         return TelephonyManager.CARRIER_PRIVILEGE_STATUS_NO_ACCESS;
     }
+
+    @Override
+    public int checkCarrierPrivilegesForPackage(String pkgname) {
+        PackageManager packageManager = mPhone.getContext().getPackageManager();
+        try {
+            PackageInfo pInfo = packageManager.getPackageInfo(pkgname,
+                PackageManager.GET_SIGNATURES);
+            Signature[] signatures = pInfo.signatures;
+            for (Signature sig : signatures) {
+                int hasAccess = UiccController.getInstance().getUiccCard().hasCarrierPrivileges(
+                        sig, pInfo.packageName);
+                if (hasAccess != TelephonyManager.CARRIER_PRIVILEGE_STATUS_NO_ACCESS) {
+                    return hasAccess;
+                }
+            }
+        } catch (PackageManager.NameNotFoundException ex) {
+            loge("NameNotFoundException: " + ex);
+        }
+        return TelephonyManager.CARRIER_PRIVILEGE_STATUS_NO_ACCESS;
+    }
 }