Lookup SIP Profile using profile name instead of URI.

Bug: 21292154
Change-Id: Ie5966b401fb87c70fa40cc2435de3ef0747c5cdd
diff --git a/sip/src/com/android/services/telephony/sip/SipConnectionService.java b/sip/src/com/android/services/telephony/sip/SipConnectionService.java
index ae21d73..ab4223a 100644
--- a/sip/src/com/android/services/telephony/sip/SipConnectionService.java
+++ b/sip/src/com/android/services/telephony/sip/SipConnectionService.java
@@ -110,8 +110,8 @@
         if (attemptCall) {
             // The ID used for SIP-based phone account is the SIP profile Uri. Use it to find
             // the actual profile.
-            String profileUri = accountHandle.getId();
-            findProfile(profileUri, new IProfileFinderCallback() {
+            String profileName = accountHandle.getId();
+            findProfile(profileName, new IProfileFinderCallback() {
                 @Override
                 public void onFound(SipProfile profile) {
                     if (profile == null) {
@@ -205,7 +205,7 @@
      * in communicating with the database, so it is done asynchronously with a separate thread and a
      * callback interface.
      */
-    private void findProfile(final String profileUri, final IProfileFinderCallback callback) {
+    private void findProfile(final String profileName, final IProfileFinderCallback callback) {
         if (VERBOSE) log("findProfile");
         new Thread(new Runnable() {
             @Override
@@ -214,7 +214,7 @@
                 List<SipProfile> profileList = mSipProfileDb.retrieveSipProfileList();
                 if (profileList != null) {
                     for (SipProfile profile : profileList) {
-                        if (Objects.equals(profileUri, profile.getUriString())) {
+                        if (Objects.equals(profileName, profile.getProfileName())) {
                             profileToUse = profile;
                             break;
                         }