Adn queries for multi-SIM. (3/3)

Process Telecom method to take in a subscription account and
return the URI for an ADN query for that account.

Bug: 17917937

Change-Id: Idedbe1c6fc63d21c7673c50c1d7894ba981d27ea
diff --git a/src/com/android/server/telecom/TelecomServiceImpl.java b/src/com/android/server/telecom/TelecomServiceImpl.java
index 52f258f..0e20b29 100644
--- a/src/com/android/server/telecom/TelecomServiceImpl.java
+++ b/src/com/android/server/telecom/TelecomServiceImpl.java
@@ -23,6 +23,7 @@
 import android.content.Intent;
 import android.content.pm.PackageManager;
 import android.content.res.Resources;
+import android.net.Uri;
 import android.os.Binder;
 import android.os.Bundle;
 import android.os.Handler;
@@ -483,6 +484,26 @@
     }
 
     /**
+     * @see android.telecom.TelecomManager#getAdnUriForPhoneAccount
+     */
+    @Override
+    public Uri getAdnUriForPhoneAccount(PhoneAccountHandle accountHandle) {
+        enforceModifyPermissionOrDefaultDialer();
+
+        // Switch identity so that TelephonyManager checks Telecom's permissions instead.
+        long token = Binder.clearCallingIdentity();
+        String retval = "content://icc/adn/";
+        try {
+            long subId = mPhoneAccountRegistrar.getSubscriptionIdForPhoneAccount(accountHandle);
+            retval = retval + "subId/" + subId;
+        } finally {
+            Binder.restoreCallingIdentity(token);
+        }
+
+        return Uri.parse(retval);
+    }
+
+    /**
      * @see android.telecom.TelecomManager#isTtySupported
      */
     @Override