diff --git a/src/com/android/telecomm/CallActivity.java b/src/com/android/telecomm/CallActivity.java
index f354291..72437a2 100644
--- a/src/com/android/telecomm/CallActivity.java
+++ b/src/com/android/telecomm/CallActivity.java
@@ -24,6 +24,7 @@
 import android.net.Uri;
 import android.os.Bundle;
 import android.os.UserManager;
+import android.telecomm.PhoneAccount;
 import android.telecomm.PhoneAccountHandle;
 import android.telecomm.TelecommManager;
 import android.telephony.DisconnectCause;
@@ -123,9 +124,9 @@
         String scheme = handle.getScheme();
         String uriString = handle.getSchemeSpecificPart();
 
-        if (!Constants.SCHEME_VOICEMAIL.equals(scheme)) {
+        if (!PhoneAccount.SCHEME_VOICEMAIL.equals(scheme)) {
             handle = Uri.fromParts(PhoneNumberUtils.isUriNumber(uriString) ?
-                    Constants.SCHEME_SIP : Constants.SCHEME_TEL, uriString, null);
+                    PhoneAccount.SCHEME_SIP : PhoneAccount.SCHEME_TEL, uriString, null);
         }
 
         UserManager userManager = (UserManager) getSystemService(Context.USER_SERVICE);
diff --git a/src/com/android/telecomm/Constants.java b/src/com/android/telecomm/Constants.java
index 9967fa2..656114f 100644
--- a/src/com/android/telecomm/Constants.java
+++ b/src/com/android/telecomm/Constants.java
@@ -28,8 +28,5 @@
     // URI schemes
     //
 
-    public static final String SCHEME_SIP = "sip";
     public static final String SCHEME_SMSTO = "smsto";
-    public static final String SCHEME_TEL = "tel";
-    public static final String SCHEME_VOICEMAIL = "voicemail";
-}
\ No newline at end of file
+}
diff --git a/src/com/android/telecomm/Log.java b/src/com/android/telecomm/Log.java
index ebcc175..3b241fa 100644
--- a/src/com/android/telecomm/Log.java
+++ b/src/com/android/telecomm/Log.java
@@ -17,6 +17,7 @@
 package com.android.telecomm;
 
 import android.net.Uri;
+import android.telecomm.PhoneAccount;
 import android.telephony.PhoneNumberUtils;
 
 import java.security.MessageDigest;
@@ -134,7 +135,7 @@
             Uri uri = (Uri) pii;
 
             // All Uri's which are not "tel" go through normal pii() method.
-            if (!"tel".equals(uri.getScheme())) {
+            if (!PhoneAccount.SCHEME_TEL.equals(uri.getScheme())) {
                 return pii(pii);
             } else {
                 pii = uri.getSchemeSpecificPart();
diff --git a/src/com/android/telecomm/NewOutgoingCallIntentBroadcaster.java b/src/com/android/telecomm/NewOutgoingCallIntentBroadcaster.java
index 1032018..14c86bc 100644
--- a/src/com/android/telecomm/NewOutgoingCallIntentBroadcaster.java
+++ b/src/com/android/telecomm/NewOutgoingCallIntentBroadcaster.java
@@ -24,6 +24,7 @@
 import android.net.Uri;
 import android.os.UserHandle;
 import android.telecomm.GatewayInfo;
+import android.telecomm.PhoneAccount;
 import android.telecomm.TelecommManager;
 import android.telecomm.VideoProfile;
 import android.telephony.DisconnectCause;
@@ -114,7 +115,7 @@
             }
 
             Uri resultHandleUri = Uri.fromParts(PhoneNumberUtils.isUriNumber(resultNumber) ?
-                    Constants.SCHEME_SIP : Constants.SCHEME_TEL, resultNumber, null);
+                    PhoneAccount.SCHEME_SIP : PhoneAccount.SCHEME_TEL, resultNumber, null);
 
             Uri originalUri = mIntent.getData();
 
@@ -163,7 +164,7 @@
             return DisconnectCause.INVALID_NUMBER;
         }
 
-        boolean isVoicemailNumber = Constants.SCHEME_VOICEMAIL.equals(handle.getScheme());
+        boolean isVoicemailNumber = PhoneAccount.SCHEME_VOICEMAIL.equals(handle.getScheme());
         if (isVoicemailNumber) {
             if (Intent.ACTION_CALL.equals(action)) {
                 // Voicemail calls will be handled directly by the telephony connection manager
@@ -228,7 +229,7 @@
         if (callImmediately) {
             Log.i(this, "Placing call immediately instead of waiting for "
                     + " OutgoingCallBroadcastReceiver: %s", intent);
-            String scheme = isUriNumber ? Constants.SCHEME_SIP : Constants.SCHEME_TEL;
+            String scheme = isUriNumber ? PhoneAccount.SCHEME_SIP : PhoneAccount.SCHEME_TEL;
             boolean speakerphoneOn = mIntent.getBooleanExtra(
                     TelecommManager.EXTRA_START_CALL_WITH_SPEAKERPHONE, false);
             int videoState = mIntent.getIntExtra(
diff --git a/tests/src/com/android/telecomm/testapps/CallServiceNotifier.java b/tests/src/com/android/telecomm/testapps/CallServiceNotifier.java
index e8aa19f..e99c395 100644
--- a/tests/src/com/android/telecomm/testapps/CallServiceNotifier.java
+++ b/tests/src/com/android/telecomm/testapps/CallServiceNotifier.java
@@ -109,7 +109,7 @@
                 .withIconResId(R.drawable.stat_sys_phone_call)
                 .withLabel("TelecommTestApp Call Provider")
                 .withShortDescription("a short description for the call provider")
-                .withSupportedUriScheme("tel")
+                .withSupportedUriScheme(PhoneAccount.SCHEME_TEL)
                 .build());
 
         telecommManager.registerPhoneAccount(PhoneAccount.builder()
diff --git a/tests/src/com/android/telecomm/testapps/TestConnectionService.java b/tests/src/com/android/telecomm/testapps/TestConnectionService.java
index 2f8df3d..bac3915 100644
--- a/tests/src/com/android/telecomm/testapps/TestConnectionService.java
+++ b/tests/src/com/android/telecomm/testapps/TestConnectionService.java
@@ -26,6 +26,7 @@
 import android.telecomm.AudioState;
 import android.telecomm.Conference;
 import android.telecomm.Connection;
+import android.telecomm.PhoneAccount;
 import android.telecomm.PhoneCapabilities;
 import android.telecomm.PropertyPresentation;
 import android.telecomm.ConnectionRequest;
@@ -233,8 +234,6 @@
         }
     }
 
-    private static final String SCHEME_TEL = "tel";
-
     private final List<TestConnection> mCalls = new ArrayList<>();
     private final Handler mHandler = new Handler();
 
@@ -318,7 +317,7 @@
 
             // Use dummy number for testing incoming calls.
             Uri handle = providedHandle == null ?
-                    Uri.fromParts(SCHEME_TEL, getDummyNumber(isVideoCall), null) : providedHandle;
+                    Uri.fromParts(PhoneAccount.SCHEME_TEL, getDummyNumber(isVideoCall), null) : providedHandle;
             if (isVideoCall) {
                 TestVideoProvider testVideoCallProvider =
                         new TestVideoProvider(getApplicationContext());
diff --git a/tests/src/com/android/telecomm/tests/unit/PhoneAccountRegistrarTest.java b/tests/src/com/android/telecomm/tests/unit/PhoneAccountRegistrarTest.java
index 41b7924..b64714e 100644
--- a/tests/src/com/android/telecomm/tests/unit/PhoneAccountRegistrarTest.java
+++ b/tests/src/com/android/telecomm/tests/unit/PhoneAccountRegistrarTest.java
@@ -98,7 +98,7 @@
                 .withIconResId(0)
                 .withLabel("label2")
                 .withShortDescription("desc2")
-                .withSupportedUriScheme("tel")
+                .withSupportedUriScheme(PhoneAccount.SCHEME_TEL)
                 .build());
     }
 
@@ -214,7 +214,7 @@
         assertEquals(4, mRegistrar.getAllPhoneAccountHandles().size());
         assertEquals(3, mRegistrar.getOutgoingPhoneAccounts().size());
         assertEquals(null, mRegistrar.getSimCallManager());
-        assertEquals(null, mRegistrar.getDefaultOutgoingPhoneAccount("tel"));
+        assertEquals(null, mRegistrar.getDefaultOutgoingPhoneAccount(PhoneAccount.SCHEME_TEL));
     }
 
     public void testSimCallManager() throws Exception {
@@ -240,23 +240,25 @@
 
     public void testDefaultOutgoing() {
         // Establish initial conditions
-        assertEquals(null, mRegistrar.getDefaultOutgoingPhoneAccount("tel"));
+        assertEquals(null, mRegistrar.getDefaultOutgoingPhoneAccount(PhoneAccount.SCHEME_TEL));
         PhoneAccountHandle h = new PhoneAccountHandle(new ComponentName("pkg0", "cls0"), "id1");
         mRegistrar.setUserSelectedOutgoingPhoneAccount(h);
-        assertPhoneAccountHandleEquals(h, mRegistrar.getDefaultOutgoingPhoneAccount("tel"));
+        assertPhoneAccountHandleEquals(h, mRegistrar.getDefaultOutgoingPhoneAccount(
+                        PhoneAccount.SCHEME_TEL));
         // If account is un-registered, querying returns null
         mRegistrar.unregisterPhoneAccount(h);
-        assertEquals(null, mRegistrar.getDefaultOutgoingPhoneAccount("tel"));
+        assertEquals(null, mRegistrar.getDefaultOutgoingPhoneAccount(PhoneAccount.SCHEME_TEL));
         // But if account is re-registered, setting comes back
         mRegistrar.registerPhoneAccount(makeQuickAccount("pkg0", "cls0", "id1", 99));
-        assertPhoneAccountHandleEquals(h, mRegistrar.getDefaultOutgoingPhoneAccount("tel"));
+        assertPhoneAccountHandleEquals(h, mRegistrar.getDefaultOutgoingPhoneAccount(
+                        PhoneAccount.SCHEME_TEL));
         // De-register by setting to null
         mRegistrar.setUserSelectedOutgoingPhoneAccount(null);
-        assertEquals(null, mRegistrar.getDefaultOutgoingPhoneAccount("tel"));
+        assertEquals(null, mRegistrar.getDefaultOutgoingPhoneAccount(PhoneAccount.SCHEME_TEL));
         // If argument not have CALL_PROVIDER capability, this is a no-op
         mRegistrar.setUserSelectedOutgoingPhoneAccount(
                 new PhoneAccountHandle(new ComponentName("pkg0", "cls0"), "id0"));
-        assertEquals(null, mRegistrar.getDefaultOutgoingPhoneAccount("tel"));
+        assertEquals(null, mRegistrar.getDefaultOutgoingPhoneAccount(PhoneAccount.SCHEME_TEL));
         // If only have one account, it is the default
         mRegistrar.unregisterPhoneAccount(
                 new PhoneAccountHandle(new ComponentName("pkg0", "cls0"), "id0"));
@@ -266,7 +268,7 @@
                 new PhoneAccountHandle(new ComponentName("pkg1", "cls1"), "id2"));
         assertPhoneAccountHandleEquals(
                 new PhoneAccountHandle(new ComponentName("pkg1", "cls1"), "id3"),
-                mRegistrar.getDefaultOutgoingPhoneAccount("tel"));
+                mRegistrar.getDefaultOutgoingPhoneAccount(PhoneAccount.SCHEME_TEL));
         // If have one account but not suitable, default returns null
         mRegistrar.unregisterPhoneAccount(
                 new PhoneAccountHandle(new ComponentName("pkg1", "cls1"), "id3"));
@@ -279,7 +281,7 @@
                 .withLabel("label0")
                 .withShortDescription("desc0")
                 .build());
-        assertEquals(null, mRegistrar.getDefaultOutgoingPhoneAccount("tel"));
+        assertEquals(null, mRegistrar.getDefaultOutgoingPhoneAccount(PhoneAccount.SCHEME_TEL));
     }
 
     private static PhoneAccount makeQuickAccount(String pkg, String cls, String id, int idx) {
@@ -303,4 +305,4 @@
         s.simCallManager = new PhoneAccountHandle(new ComponentName("pkg0", "cls0"), "id1");
         return s;
     }
-}
\ No newline at end of file
+}
