Fix #911 calls.

We were previously calling Uri.parse() on the number which caused the #
to be recognized as a uri fragment separator when it should have been
part of the scheme-specific-part. Later on when we got the scheme
specific part to actually dial the number, we got an empty string.

The fix is to use Uri.fromParts() to build the string with the number
being explicitly part of the scheme-specific part.

Bug: 15315198
Change-Id: I1231d446c6ba98df417a83843181957a4d788918
diff --git a/src/com/android/telecomm/NewOutgoingCallIntentBroadcaster.java b/src/com/android/telecomm/NewOutgoingCallIntentBroadcaster.java
index 324c25e..41d568f 100644
--- a/src/com/android/telecomm/NewOutgoingCallIntentBroadcaster.java
+++ b/src/com/android/telecomm/NewOutgoingCallIntentBroadcaster.java
@@ -159,7 +159,9 @@
             return;
         }
 
-        if (!PhoneNumberUtils.isUriNumber(handle)) {
+        boolean isUriNumber = PhoneNumberUtils.isUriNumber(handle);
+
+        if (!isUriNumber) {
             handle = PhoneNumberUtils.convertKeypadLettersToDigits(handle);
             handle = PhoneNumberUtils.stripSeparators(handle);
         }
@@ -195,7 +197,9 @@
         if (callImmediately) {
             Log.i(this, "Placing call immediately instead of waiting for "
                     + " OutgoingCallBroadcastReceiver: %s", intent);
-            mCallsManager.placeOutgoingCall(Uri.parse(handle), mContactInfo, null);
+            String scheme = isUriNumber ? SCHEME_SIP : SCHEME_TEL;
+            mCallsManager.placeOutgoingCall(
+                    Uri.fromParts(scheme, handle, null), mContactInfo, null);
 
             // Don't return but instead continue and send the ACTION_NEW_OUTGOING_CALL broadcast
             // so that third parties can still inspect (but not intercept) the outgoing call. When