Merge "Protect IExtPhone APIs with manifest permissions"
diff --git a/extphone/Android.bp b/extphone/Android.bp
index ed2afcf..81195af 100644
--- a/extphone/Android.bp
+++ b/extphone/Android.bp
@@ -1,6 +1,7 @@
 
 java_library {
     name: "extphonelib",
+    provides_uses_lib: "com.qti.extphone.extphonelib",
     installable: true,
     sdk_version: "system_current",
 
@@ -14,6 +15,7 @@
 
 java_library {
     name: "extphonelib-product",
+    provides_uses_lib: "com.qti.extphone.extphonelib-product",
     installable: true,
     sdk_version: "system_current",
 
@@ -30,7 +32,6 @@
 prebuilt_etc {
 
     name: "extphonelib.xml",
-
     // This will install the file in /system_ext/etc/permissions
 
     src: "extphonelib.xml",
diff --git a/ims/ims-ext-common/Android.bp b/ims/ims-ext-common/Android.bp
index c9b0215..00799d2 100644
--- a/ims/ims-ext-common/Android.bp
+++ b/ims/ims-ext-common/Android.bp
@@ -1,6 +1,7 @@
 
 java_library {
     name: "ims-ext-common",
+    provides_uses_lib: "ims-ext-common",
     installable: true,
     sdk_version: "system_current",
     aidl: {
diff --git a/ims/ims-ext-common/src/org/codeaurora/ims/QtiCarrierConfigs.java b/ims/ims-ext-common/src/org/codeaurora/ims/QtiCarrierConfigs.java
index 32a2a06..6e0fd3b 100644
--- a/ims/ims-ext-common/src/org/codeaurora/ims/QtiCarrierConfigs.java
+++ b/ims/ims-ext-common/src/org/codeaurora/ims/QtiCarrierConfigs.java
@@ -133,4 +133,15 @@
      */
     public static final String KEY_CARRIER_CALL_PROGRESS_NOTIFICATION_SUPPORTED =
             "carrier_call_progress_notification";
+
+    /* List of numbers that should be treated as customer service numbers.
+     * Number list are whitelisted in carrier config file, more numbers could
+     * be added, below is format.
+     * <string-array name="carrier_support_video_service_numbers" num="2">
+     *     <item value="0532100860086"/>
+     *     <item value="0201008616"/>
+     * </string-array>
+     */
+    public static final String KEY_CARRIER_VIDEO_CUSTOMER_SERVICE_NUMBERS =
+        "carrier_support_video_service_numbers";
 }
diff --git a/ims/ims-ext-common/src/org/codeaurora/ims/utils/QtiCarrierConfigHelper.java b/ims/ims-ext-common/src/org/codeaurora/ims/utils/QtiCarrierConfigHelper.java
index fbb2ca3..132cee2 100644
--- a/ims/ims-ext-common/src/org/codeaurora/ims/utils/QtiCarrierConfigHelper.java
+++ b/ims/ims-ext-common/src/org/codeaurora/ims/utils/QtiCarrierConfigHelper.java
@@ -226,6 +226,21 @@
         return false;
     }
 
+    public String[] getStringArray(Context context, int phoneId, String key) {
+        if (!isValidPhoneId(phoneId)) {
+            Log.d(TAG, "Invalid phone ID: " + phoneId);
+            return null;
+        }
+        sanityCheckConfigsLoaded(context, phoneId);
+        logd("getString", "mInitialized - " + mInitialized.get() + " context - " + context);
+        PersistableBundle pb = mConfigsMap.get(phoneId);
+        if (pb != null) {
+            return pb.getStringArray(key);
+        }
+        Log.d(TAG, "WARNING, no carrier configs on phone Id: " + phoneId);
+        return null;
+    }
+
     private static void logd(String tag, String msg) {
         if (DEBUG) {
             android.util.Log.d(TAG, tag + DELIMITER + msg);
diff --git a/ims/ims-ext-common/src/org/codeaurora/ims/utils/QtiImsExtUtils.java b/ims/ims-ext-common/src/org/codeaurora/ims/utils/QtiImsExtUtils.java
index 97ecf9c..20bde35 100644
--- a/ims/ims-ext-common/src/org/codeaurora/ims/utils/QtiImsExtUtils.java
+++ b/ims/ims-ext-common/src/org/codeaurora/ims/utils/QtiImsExtUtils.java
@@ -725,4 +725,13 @@
         return isCarrierConfigEnabled(phoneId, context,
                 QtiCarrierConfigs.KEY_CARRIER_CALL_PROGRESS_NOTIFICATION_SUPPORTED);
     }
+
+    /**
+     * Retrieves the customer service numbers stored for specific operator
+     * Returns stored numbers, or null otherwise.
+     */
+    public static String[] getCustomerServiceNumbers(int phoneId, Context context) {
+        return QtiCarrierConfigHelper.getInstance().getStringArray(context, phoneId,
+                QtiCarrierConfigs.KEY_CARRIER_VIDEO_CUSTOMER_SERVICE_NUMBERS);
+    }
 }
diff --git a/qti-hidl-wrapper/Android.bp b/qti-hidl-wrapper/Android.bp
index 2620d86..7db60fe 100644
--- a/qti-hidl-wrapper/Android.bp
+++ b/qti-hidl-wrapper/Android.bp
@@ -2,6 +2,7 @@
 java_library {
 
     name: "qti-telephony-hidl-wrapper",
+    provides_uses_lib: "qti-telephony-hidl-wrapper",
     installable: true,
     system_ext_specific: true,
     sdk_version: "system_current",
@@ -16,6 +17,7 @@
 java_library {
 
     name: "qti-telephony-hidl-wrapper-prd",
+    provides_uses_lib: "qti-telephony-hidl-wrapper-prd",
     installable: true,
     product_specific: true,
     sdk_version: "system_current",
diff --git a/qti-utils/Android.bp b/qti-utils/Android.bp
index 851def1..183d392 100644
--- a/qti-utils/Android.bp
+++ b/qti-utils/Android.bp
@@ -1,6 +1,7 @@
 
 java_library {
     name: "qti-telephony-utils",
+    provides_uses_lib: "qti-telephony-utils",
     installable: true,
     sdk_version: "system_current",
 
@@ -14,6 +15,7 @@
 
 java_library {
     name: "qti-telephony-utils-prd",
+    provides_uses_lib: "qti-telephony-utils-prd",
     installable: true,
     sdk_version: "system_current",