Add hidden systemapi hasCarrierPrivileges(pkgname).

Change-Id: I153f5c7cff1734c87587c3741051177ce54ba654
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 15320e6..4a9ea2e 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -2870,6 +2870,19 @@
 
     /** @hide */
     @SystemApi
+    public int hasCarrierPrivileges(String pkgname) {
+        try {
+            return getITelephony().hasCarrierPrivileges(pkgname);
+        } catch (RemoteException ex) {
+            Rlog.e(TAG, "hasCarrierPrivileges RemoteException", ex);
+        } catch (NullPointerException ex) {
+            Rlog.e(TAG, "hasCarrierPrivileges NPE", ex);
+        }
+        return CARRIER_PRIVILEGE_STATUS_NO_ACCESS;
+    }
+    /** @hide */
+
+    @SystemApi
     public void dial(String number) {
         try {
             getITelephony().dial(number);
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index 7bf3b3f..3100d18 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -653,5 +653,10 @@
      * @return carrier privelege status defined in TelephonyManager.
      */
     int hasCarrierPrivileges();
+
+    /**
+     * Similar to above, but check for pkg whose name is pkgname.
+     */
+    int hasCarrierPrivileges(String pkgname);
 }