diff --git a/Android.mk b/Android.mk
index 852d0a4..48eece0 100644
--- a/Android.mk
+++ b/Android.mk
@@ -3,7 +3,6 @@
 # Build the Telecomm service.
 include $(CLEAR_VARS)
 
-LOCAL_JAVA_LIBRARIES := telephony-common
 LOCAL_STATIC_JAVA_LIBRARIES := \
         guava \
 
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index c49dca9..2a90f86 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -177,12 +177,5 @@
             </intent-filter>
         </receiver>
 
-        <activity android:name=".RespondViaSmsSettings$Settings"
-                  android:label="@string/respond_via_sms_setting_title"
-                  android:configChanges="orientation|screenSize|keyboardHidden">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-            </intent-filter>
-        </activity>
     </application>
 </manifest>
diff --git a/res/menu/respond_via_message_settings_menu.xml b/res/menu/respond_via_message_settings_menu.xml
deleted file mode 100644
index 6f5e246..0000000
--- a/res/menu/respond_via_message_settings_menu.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012 Google Inc.
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<!-- Menu for Respond-via-Message settings screen. -->
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:id="@+id/respond_via_message_reset"
-          android:title="@string/respond_via_sms_menu_reset_default_activity" />
-</menu>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 747eca7..0c46053 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -49,30 +49,4 @@
     <!-- Content description of the speakerphone enabled notification icon for
          accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
     <string name="accessibility_speakerphone_enabled">Speakerphone enabled.</string>
-
-    <!-- Canned response for the "Respond via SMS" feature for incoming calls. [CHAR LIMIT=35] -->
-    <string name="respond_via_sms_canned_response_1">Can\'t talk now. What\'s up?</string>
-    <!-- Canned response for the "Respond via SMS" feature for incoming calls. [CHAR LIMIT=35] -->
-    <string name="respond_via_sms_canned_response_2">I\'ll call you right back.</string>
-    <!-- Canned response for the "Respond via SMS" feature for incoming calls. [CHAR LIMIT=35] -->
-    <string name="respond_via_sms_canned_response_3">I\'ll call you later.</string>
-    <!-- Canned response for the "Respond via SMS" feature for incoming calls. [CHAR LIMIT=35] -->
-    <string name="respond_via_sms_canned_response_4">Can\'t talk now. Call me later?</string>
-
-    <!-- Title of settings screen for managing the "Respond via SMS" feature. [CHAR LIMIT=30] -->
-    <string name="respond_via_sms_setting_title">Quick responses</string>
-    <!-- Slightly more verbose title of settings screen for managing the
-         "Respond via SMS" feature. [CHAR LIMIT=30] -->
-    <string name="respond_via_sms_setting_title_2">Edit quick responses</string>
-    <!-- Settings summary string for the "Respond via SMS" feature. [CHAR LIMIT=40] -->
-    <string name="respond_via_sms_setting_summary"></string>
-    <!-- Dialog title when changing a string for the "Respond via SMS" feature. [CHAR LIMIT=30] -->
-    <string name="respond_via_sms_edittext_dialog_title">Quick response</string>
-    <!-- Menu option in  "Respond via SMS" that allows user to reset the default
-         activity used to handle "Respond via SMS" [CHAR LIMIT=30] -->
-    <string name="respond_via_sms_menu_reset_default_activity">Reset default app</string>
-
-    <!-- "Respond via SMS": Confirmation message shown after sending
-        a text response. [CHAR LIMIT=40] -->
-    <string name="respond_via_sms_confirmation_format">Message sent to <xliff:g id="phone_number">%s</xliff:g>.</string>
 </resources>
diff --git a/res/xml/respond_via_sms_settings.xml b/res/xml/respond_via_sms_settings.xml
deleted file mode 100644
index a8eb46c..0000000
--- a/res/xml/respond_via_sms_settings.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<!-- Settings screen that lets the user manage the canned responses
-     for the "Respond via SMS" feature; see RespondViaSmsManager.java -->
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
-     android:title="@string/respond_via_sms_setting_title_2">
-
-    <!-- Ultra-simple implementation for now: just provide 4 fixed slots
-         with customizable strings. -->
-
-    <!-- TODO: Potential UI improvements:
-         (1) Allow editing the strings in place, rather than having to tap
-             each one and edit it via the popup dialog.
-         (2) Allow reordering the strings by drag-and-drop.
-         (3) Provide an "Add new string..." option? -->
-
-    <!-- The defaultValues here must agree with the values used with
-         prefs.getString() in RespondViaSmsManager.loadCannedResponses(). -->
-
-    <!-- Use MultiLineTitleEditTextPreference instead of the standard
-         EditTextPreference here, to allow the preference "title" to wrap
-         onto multiple lines if the customized messages are long enough. -->
-
-    <com.android.telecomm.MultiLineTitleEditTextPreference
-        android:key="canned_response_pref_1"
-        android:defaultValue="@string/respond_via_sms_canned_response_1"
-        android:dialogTitle="@string/respond_via_sms_edittext_dialog_title" />
-
-    <com.android.telecomm.MultiLineTitleEditTextPreference
-        android:key="canned_response_pref_2"
-        android:defaultValue="@string/respond_via_sms_canned_response_2"
-        android:dialogTitle="@string/respond_via_sms_edittext_dialog_title" />
-
-    <com.android.telecomm.MultiLineTitleEditTextPreference
-        android:key="canned_response_pref_3"
-        android:defaultValue="@string/respond_via_sms_canned_response_3"
-        android:dialogTitle="@string/respond_via_sms_edittext_dialog_title" />
-
-    <com.android.telecomm.MultiLineTitleEditTextPreference
-        android:key="canned_response_pref_4"
-        android:defaultValue="@string/respond_via_sms_canned_response_4"
-        android:dialogTitle="@string/respond_via_sms_edittext_dialog_title" />
-
-</PreferenceScreen>
diff --git a/src/com/android/telecomm/Call.java b/src/com/android/telecomm/Call.java
index 104ff4e..66f9366 100644
--- a/src/com/android/telecomm/Call.java
+++ b/src/com/android/telecomm/Call.java
@@ -27,7 +27,6 @@
 import android.telecomm.CallServiceDescriptor;
 import android.telecomm.CallState;
 import android.telecomm.GatewayInfo;
-import android.telecomm.Response;
 import android.telecomm.TelecommConstants;
 import android.telephony.DisconnectCause;
 import android.telephony.PhoneNumberUtils;
@@ -37,14 +36,10 @@
 import com.android.internal.telephony.CallerInfoAsyncQuery;
 import com.android.internal.telephony.CallerInfoAsyncQuery.OnQueryCompleteListener;
 
-import com.android.internal.telephony.SmsApplication;
 import com.android.telecomm.ContactsAsyncHelper.OnImageLoadCompleteListener;
+import com.google.android.collect.Sets;
 import com.google.common.base.Preconditions;
-import com.google.common.collect.Sets;
 
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.List;
 import java.util.Locale;
 import java.util.Set;
 
@@ -65,12 +60,6 @@
         void onFailedIncomingCall(Call call);
         void onRequestingRingback(Call call, boolean requestingRingback);
         void onPostDialWait(Call call, String remaining);
-        void onIsConferenceCapableChanged(Call call, boolean isConferenceCapable);
-        void onExpiredConferenceCall(Call call);
-        void onConfirmedConferenceCall(Call call);
-        void onParentChanged(Call call);
-        void onChildrenChanged(Call call);
-        void onCannedSmsResponsesLoaded(Call call);
     }
 
     private static final OnQueryCompleteListener sCallerInfoQueryListener =
@@ -191,27 +180,13 @@
     /** Incoming call-info to use when direct-to-voicemail query finishes. */
     private CallInfo mPendingDirectToVoicemailCallInfo;
 
-    private boolean mIsConferenceCapable = false;
-
-    private boolean mIsConference = false;
-
-    private Call mParentCall = null;
-
-    private List<Call> mChildCalls = new LinkedList<>();
-
-    /** Set of text message responses allowed for this call, if applicable. */
-    private List<String> mCannedSmsResponses = Collections.EMPTY_LIST;
-
-    /** Whether an attempt has been made to load the text message responses. */
-    private boolean mCannedSmsResponsesLoadingStarted = false;
-
     /**
      * Creates an empty call object.
      *
      * @param isIncoming True if this is an incoming call.
      */
-    Call(boolean isIncoming, boolean isConference) {
-        this(null, null, isIncoming, isConference);
+    Call(boolean isIncoming) {
+        this(null, null, isIncoming);
     }
 
     /**
@@ -221,13 +196,11 @@
      * @param gatewayInfo Gateway information to use for the call.
      * @param isIncoming True if this is an incoming call.
      */
-    Call(Uri handle, GatewayInfo gatewayInfo, boolean isIncoming, boolean isConference) {
-        mState = isConference ? CallState.ACTIVE : CallState.NEW;
+    Call(Uri handle, GatewayInfo gatewayInfo, boolean isIncoming) {
+        mState = CallState.NEW;
         setHandle(handle);
         mGatewayInfo = gatewayInfo;
         mIsIncoming = isIncoming;
-        mIsConference = isConference;
-        maybeLoadCannedSmsResponses();
     }
 
     void addListener(Listener listener) {
@@ -248,15 +221,7 @@
     }
 
     CallState getState() {
-        if (mIsConference) {
-            if (!mChildCalls.isEmpty()) {
-                // If we have child calls, just return the child call.
-                return mChildCalls.get(0).getState();
-            }
-            return CallState.ACTIVE;
-        } else {
-            return mState;
-        }
+        return mState;
     }
 
     /**
@@ -271,7 +236,6 @@
         if (mState != newState) {
             Log.v(this, "setState %s -> %s", mState, newState);
             mState = newState;
-            maybeLoadCannedSmsResponses();
         }
     }
 
@@ -379,27 +343,6 @@
         mConnectTimeMillis = connectTimeMillis;
     }
 
-    boolean isConferenceCapable() {
-        return mIsConferenceCapable;
-    }
-
-    void setIsConferenceCapable(boolean isConferenceCapable) {
-        if (mIsConferenceCapable != isConferenceCapable) {
-            mIsConferenceCapable = isConferenceCapable;
-            for (Listener l : mListeners) {
-                l.onIsConferenceCapableChanged(this, mIsConferenceCapable);
-            }
-        }
-    }
-
-    Call getParentCall() {
-        return mParentCall;
-    }
-
-    List<Call> getChildCalls() {
-        return mChildCalls;
-    }
-
     CallServiceWrapper getCallService() {
         return mCallService;
     }
@@ -507,7 +450,7 @@
             public void run() {
                 processDirectToVoicemail();
             }
-        }, Timeouts.getDirectToVoicemailMillis());
+        }, Timeouts.getDirectToVoicemail());
     }
 
     void processDirectToVoicemail() {
@@ -517,7 +460,7 @@
                 // TODO(santoscordon): Once we move State handling from CallsManager to Call, we
                 // will not need to set RINGING state prior to calling reject.
                 setState(CallState.RINGING);
-                reject(false, null);
+                reject();
             } else {
                 // TODO(santoscordon): Make this class (not CallsManager) responsible for changing
                 // the call state to RINGING.
@@ -681,11 +624,8 @@
 
     /**
      * Rejects the call if it is ringing.
-     *
-     * @param rejectWithMessage Whether to send a text message as part of the call rejection.
-     * @param textMessage An optional text message to send as part of the rejection.
      */
-    void reject(boolean rejectWithMessage, String textMessage) {
+    void reject() {
         Preconditions.checkNotNull(mCallService);
 
         // Check to verify that the call is still in the ringing state. A call can change states
@@ -800,133 +740,6 @@
         getCallService().onPostDialContinue(this, proceed);
     }
 
-    void conferenceInto(Call conferenceCall) {
-        if (mCallService == null) {
-            Log.w(this, "conference requested on a call without a call service.");
-        } else {
-            mCallService.conference(conferenceCall, this);
-        }
-    }
-
-    void expireConference() {
-        // The conference call expired before we got a confirmation of the conference from the
-        // call service...so start shutting down.
-        clearCallService();
-        for (Listener l : mListeners) {
-            l.onExpiredConferenceCall(this);
-        }
-    }
-
-    void confirmConference() {
-        Log.v(this, "confirming Conf call %s", mListeners);
-        for (Listener l : mListeners) {
-            l.onConfirmedConferenceCall(this);
-        }
-    }
-
-    void splitFromConference() {
-        // TODO(santoscordon): todo
-    }
-
-    void setParentCall(Call parentCall) {
-        if (parentCall == this) {
-            Log.e(this, new Exception(), "setting the parent to self");
-            return;
-        }
-        Preconditions.checkState(parentCall == null || mParentCall == null);
-
-        Call oldParent = mParentCall;
-        if (mParentCall != null) {
-            mParentCall.removeChildCall(this);
-        }
-        mParentCall = parentCall;
-        if (mParentCall != null) {
-            mParentCall.addChildCall(this);
-        }
-
-        for (Listener l : mListeners) {
-            l.onParentChanged(this);
-        }
-    }
-
-    private void addChildCall(Call call) {
-        if (!mChildCalls.contains(call)) {
-            mChildCalls.add(call);
-
-            for (Listener l : mListeners) {
-                l.onChildrenChanged(this);
-            }
-        }
-    }
-
-    private void removeChildCall(Call call) {
-        if (mChildCalls.remove(call)) {
-            for (Listener l : mListeners) {
-                l.onChildrenChanged(this);
-            }
-        }
-    }
-
-    /**
-     * Return whether the user can respond to this {@code Call} via an SMS message.
-     *
-     * @return true if the "Respond via SMS" feature should be enabled
-     * for this incoming call.
-     *
-     * The general rule is that we *do* allow "Respond via SMS" except for
-     * the few (relatively rare) cases where we know for sure it won't
-     * work, namely:
-     *   - a bogus or blank incoming number
-     *   - a call from a SIP address
-     *   - a "call presentation" that doesn't allow the number to be revealed
-     *
-     * In all other cases, we allow the user to respond via SMS.
-     *
-     * Note that this behavior isn't perfect; for example we have no way
-     * to detect whether the incoming call is from a landline (with most
-     * networks at least), so we still enable this feature even though
-     * SMSes to that number will silently fail.
-     */
-    boolean isRespondViaSmsCapable() {
-        if (mState != CallState.RINGING) {
-            return false;
-        }
-
-        if (getHandle() == null) {
-            // No incoming number known or call presentation is "PRESENTATION_RESTRICTED", in
-            // other words, the user should not be able to see the incoming phone number.
-            return false;
-        }
-
-        if (PhoneNumberUtils.isUriNumber(getHandle().toString())) {
-            // The incoming number is actually a URI (i.e. a SIP address),
-            // not a regular PSTN phone number, and we can't send SMSes to
-            // SIP addresses.
-            // (TODO: That might still be possible eventually, though. Is
-            // there some SIP-specific equivalent to sending a text message?)
-            return false;
-        }
-
-        // Is there a valid SMS application on the phone?
-        if (SmsApplication.getDefaultRespondViaMessageApplication(TelecommApp.getInstance(),
-                true /*updateIfNeeded*/) == null) {
-            return false;
-        }
-
-        // TODO: with some carriers (in certain countries) you *can* actually
-        // tell whether a given number is a mobile phone or not. So in that
-        // case we could potentially return false here if the incoming call is
-        // from a land line.
-
-        // If none of the above special cases apply, it's OK to enable the
-        // "Respond via SMS" feature.
-        return true;
-    }
-
-    List<String> getCannedSmsResponses() {
-        return mCannedSmsResponses;
-    }
-
     /**
      * @return True if the call is ringing, else logs the action name.
      */
@@ -1008,33 +821,4 @@
             mCallerInfo.cachedPhotoIcon = photoIcon;
         }
     }
-
-    private void maybeLoadCannedSmsResponses() {
-        if (mIsIncoming && isRespondViaSmsCapable() && !mCannedSmsResponsesLoadingStarted) {
-            Log.d(this, "maybeLoadCannedSmsResponses: starting task to load messages");
-            mCannedSmsResponsesLoadingStarted = true;
-            RespondViaSmsManager.getInstance().loadCannedTextMessages(
-                    new Response<Void, List<String>>() {
-                        @Override
-                        public void onResult(Void request, List<String>... result) {
-                            if (result.length > 0) {
-                                Log.d(this, "maybeLoadCannedSmsResponses: got %s", result[0]);
-                                mCannedSmsResponses = result[0];
-                                for (Listener l : mListeners) {
-                                    l.onCannedSmsResponsesLoaded(Call.this);
-                                }
-                            }
-                        }
-
-                        @Override
-                        public void onError(Void request, int code, String msg) {
-                            Log.w(Call.this, "Error obtaining canned SMS responses: %d %s", code,
-                                    msg);
-                        }
-                    }
-            );
-        } else {
-            Log.d(this, "maybeLoadCannedSmsResponses: doing nothing");
-        }
-    }
 }
diff --git a/src/com/android/telecomm/CallIdMapper.java b/src/com/android/telecomm/CallIdMapper.java
index e6b5c1f..7f92067 100644
--- a/src/com/android/telecomm/CallIdMapper.java
+++ b/src/com/android/telecomm/CallIdMapper.java
@@ -38,15 +38,12 @@
         mCalls.put(callId, newCall);
     }
 
-    void addCall(Call call, String id) {
-        Preconditions.checkNotNull(call);
-        ThreadUtil.checkOnMainThread();
-        mCalls.put(id, call);
-    }
-
     void addCall(Call call) {
         ThreadUtil.checkOnMainThread();
-        addCall(call, getNewId());
+        Preconditions.checkNotNull(call);
+        sIdCount++;
+        String callId = mCallIdPrefix + sIdCount;
+        mCalls.put(callId, call);
     }
 
     void removeCall(Call call) {
@@ -94,9 +91,4 @@
         // Note, no need for thread check, this method is thread safe.
         return callId != null && callId.startsWith(mCallIdPrefix);
     }
-
-    String getNewId() {
-        sIdCount++;
-        return mCallIdPrefix + sIdCount;
-    }
 }
diff --git a/src/com/android/telecomm/CallServiceSelectorWrapper.java b/src/com/android/telecomm/CallServiceSelectorWrapper.java
index 6ee73d2..05d540a 100644
--- a/src/com/android/telecomm/CallServiceSelectorWrapper.java
+++ b/src/com/android/telecomm/CallServiceSelectorWrapper.java
@@ -60,8 +60,6 @@
                                 @SuppressWarnings("unchecked")
                                 List<CallServiceDescriptor> descriptors =
                                         (List<CallServiceDescriptor>) args.arg2;
-
-                                mCallIdMapper.removeCall(callId);
                                 mPendingSelects.remove(callId).onResult(descriptors, 0, null);
                             } else {
                                 Log.w(this, "setSelectedCallServices: unknown call: %s, id: %s",
diff --git a/src/com/android/telecomm/CallServiceWrapper.java b/src/com/android/telecomm/CallServiceWrapper.java
index b963dc1..6165804 100644
--- a/src/com/android/telecomm/CallServiceWrapper.java
+++ b/src/com/android/telecomm/CallServiceWrapper.java
@@ -35,11 +35,11 @@
 import com.android.internal.telecomm.ICallServiceProvider;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Sets;
 
 import org.apache.http.conn.ClientConnectionRequest;
 
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -50,7 +50,6 @@
  * and instead should use this class to invoke methods of {@link ICallService}.
  */
 final class CallServiceWrapper extends ServiceBinder<ICallService> {
-    private static final String TAG = CallServiceWrapper.class.getSimpleName();
 
     private final class Adapter extends ICallServiceAdapter.Stub {
         private static final int MSG_NOTIFY_INCOMING_CALL = 1;
@@ -63,9 +62,7 @@
         private static final int MSG_SET_ON_HOLD = 8;
         private static final int MSG_SET_REQUESTING_RINGBACK = 9;
         private static final int MSG_ON_POST_DIAL_WAIT = 10;
-        private static final int MSG_CAN_CONFERENCE = 11;
-        private static final int MSG_SET_IS_CONFERENCED = 12;
-        private static final int MSG_ADD_CONFERENCE_CALL = 13;
+        private static final int MSG_HANDOFF_CALL = 11;
 
         private final Handler mHandler = new Handler() {
             @Override
@@ -82,7 +79,8 @@
                             mIncomingCallsManager.handleSuccessfulIncomingCall(call, callInfo);
                         } else {
                             Log.w(this, "notifyIncomingCall, unknown incoming call: %s, id: %s",
-                                    call, clientCallInfo.getId());
+                                    call,
+                                    clientCallInfo.getId());
                         }
                         break;
                     case MSG_HANDLE_SUCCESSFUL_OUTGOING_CALL: {
@@ -178,7 +176,7 @@
                         }
                         break;
                     }
-                    case MSG_ON_POST_DIAL_WAIT: {
+                    case MSG_ON_POST_DIAL_WAIT:
                         SomeArgs args = (SomeArgs) msg.obj;
                         try {
                             call = mCallIdMapper.getCall(args.arg1);
@@ -191,65 +189,14 @@
                         } finally {
                             args.recycle();
                         }
-                        break;
-                    }
-                    case MSG_CAN_CONFERENCE: {
+                    case MSG_HANDOFF_CALL:
                         call = mCallIdMapper.getCall(msg.obj);
                         if (call != null) {
-                            call.setIsConferenceCapable(msg.arg1 == 1);
+                            mCallsManager.startHandoffForCall(call);
                         } else {
-                            Log.w(CallServiceWrapper.this, "canConference, unknown call id: %s",
-                                    msg.obj);
+                            Log.w(this, "handoffCall, unknown call id: %s", msg.obj);
                         }
                         break;
-                    }
-                    case MSG_SET_IS_CONFERENCED: {
-                        SomeArgs args = (SomeArgs) msg.obj;
-                        try {
-                            Call childCall = mCallIdMapper.getCall(args.arg1);
-                            if (childCall != null) {
-                                String conferenceCallId = (String) args.arg2;
-                                Log.d(this, "setIsConferenced %s, %s", childCall, conferenceCallId);
-
-                                if (conferenceCallId == null) {
-                                    childCall.setParentCall(null);
-                                } else {
-                                    Call conferenceCall = mCallIdMapper.getCall(conferenceCallId);
-                                    if (conferenceCall != null &&
-                                            !mPendingConferenceCalls.contains(conferenceCall)) {
-                                        childCall.setParentCall(conferenceCall);
-                                    } else {
-                                        Log.w(this, "setIsConferenced, unknown conference id %s",
-                                                conferenceCallId);
-                                    }
-                                }
-                            } else {
-                                Log.w(this, "setIsConferenced, unknown call id: %s", args.arg1);
-                            }
-                        } finally {
-                            args.recycle();
-                        }
-                        break;
-                    }
-                    case MSG_ADD_CONFERENCE_CALL: {
-                        SomeArgs args = (SomeArgs) msg.obj;
-                        try {
-                            String callId = (String) args.arg1;
-                            Log.d(this, "addConferenceCall attempt %s, %s",
-                                    callId, mPendingConferenceCalls);
-
-                            Call conferenceCall = mCallIdMapper.getCall(callId);
-                            if (mPendingConferenceCalls.remove(conferenceCall)) {
-                                Log.v(this, "confirming conf call %s", conferenceCall);
-                                conferenceCall.confirmConference();
-                            } else {
-                                Log.w(this, "addConference, unknown call id: %s", callId);
-                            }
-                        } finally {
-                            args.recycle();
-                        }
-                        break;
-                    }
                 }
             }
         };
@@ -347,29 +294,12 @@
 
         /** ${inheritDoc} */
         @Override
-        public void setCanConference(String callId, boolean canConference) {
-            Log.d(this, "setCanConference(%s, %b)", callId, canConference);
-            mHandler.obtainMessage(MSG_CAN_CONFERENCE, canConference ? 1 : 0, 0, callId)
-                    .sendToTarget();
+        public void setCanConferenceWith(String callId, List<String> conferenceCapableCallIds) {
         }
 
         /** ${inheritDoc} */
         @Override
-        public void setIsConferenced(String callId, String conferenceCallId) {
-            SomeArgs args = SomeArgs.obtain();
-            args.arg1 = callId;
-            args.arg2 = conferenceCallId;
-            mHandler.obtainMessage(MSG_SET_IS_CONFERENCED, args).sendToTarget();
-        }
-
-        /** ${InheritDoc} */
-        @Override
-        public void addConferenceCall(String callId, CallInfo callInfo) {
-            mCallIdMapper.checkValidCallId(callId);
-            SomeArgs args = SomeArgs.obtain();
-            args.arg1 = callId;
-            args.arg2 = callInfo;
-            mHandler.obtainMessage(MSG_ADD_CONFERENCE_CALL, args).sendToTarget();
+        public void setIsConferenced(String conferenceCallId, String callId, boolean isConferenced) {
         }
 
         @Override
@@ -380,17 +310,22 @@
             args.arg2 = remaining;
             mHandler.obtainMessage(MSG_ON_POST_DIAL_WAIT, args).sendToTarget();
         }
+
+        /** {@inheritDoc} */
+        @Override
+        public void handoffCall(String callId) {
+            mCallIdMapper.checkValidCallId(callId);
+            mHandler.obtainMessage(MSG_HANDOFF_CALL, callId).sendToTarget();
+        }
     }
 
     private final Adapter mAdapter = new Adapter();
     private final CallsManager mCallsManager = CallsManager.getInstance();
-    private final Set<Call> mPendingIncomingCalls = new HashSet<>();
-    private final Set<Call> mPendingConferenceCalls = new HashSet<>();
+    private final Set<Call> mPendingIncomingCalls = Sets.newHashSet();
     private final CallServiceDescriptor mDescriptor;
     private final CallIdMapper mCallIdMapper = new CallIdMapper("CallService");
     private final IncomingCallsManager mIncomingCallsManager;
     private final Map<String, AsyncResultCallback<Boolean>> mPendingOutgoingCalls = new HashMap<>();
-    private final Handler mHandler = new Handler();
 
     private Binder mBinder = new Binder();
     private ICallService mServiceInterface;
@@ -586,9 +521,7 @@
     }
 
     void addCall(Call call) {
-        if (mCallIdMapper.getCallId(call) == null) {
-            mCallIdMapper.addCall(call);
-        }
+        mCallIdMapper.addCall(call);
     }
 
     /**
@@ -620,37 +553,6 @@
         }
     }
 
-    void conference(final Call conferenceCall, Call call) {
-        if (isServiceValid("conference")) {
-            try {
-                conferenceCall.setCallService(this);
-                mPendingConferenceCalls.add(conferenceCall);
-                mHandler.postDelayed(new Runnable() {
-                    @Override public void run() {
-                        if (mPendingConferenceCalls.remove(conferenceCall)) {
-                            conferenceCall.expireConference();
-                            Log.i(this, "Conference call expired: %s", conferenceCall);
-                        }
-                    }
-                }, Timeouts.getConferenceCallExpireMillis());
-
-                mServiceInterface.conference(
-                        mCallIdMapper.getCallId(conferenceCall),
-                        mCallIdMapper.getCallId(call));
-            } catch (RemoteException ignored) {
-            }
-        }
-    }
-
-    void splitFromConference(Call call) {
-        if (isServiceValid("splitFromConference")) {
-            try {
-                mServiceInterface.splitFromConference(mCallIdMapper.getCallId(call));
-            } catch (RemoteException ignored) {
-            }
-        }
-    }
-
     /** {@inheritDoc} */
     @Override
     protected void setServiceInterface(IBinder binder) {
@@ -687,12 +589,12 @@
                 mIncomingCallsManager.handleFailedIncomingCall(call);
             }
 
-            if (!mPendingIncomingCalls.isEmpty()) {
-                Log.wtf(this, "Pending calls did not get cleared.");
-                mPendingIncomingCalls.clear();
-            }
-        }
-
-        mCallIdMapper.clear();
+      if (!mPendingIncomingCalls.isEmpty()) {
+        Log.wtf(this, "Pending calls did not get cleared.");
+        mPendingIncomingCalls.clear();
+      }
     }
+
+    mCallIdMapper.clear();
+  }
 }
diff --git a/src/com/android/telecomm/CallsManager.java b/src/com/android/telecomm/CallsManager.java
index cb633ef..9a9e235 100644
--- a/src/com/android/telecomm/CallsManager.java
+++ b/src/com/android/telecomm/CallsManager.java
@@ -57,13 +57,10 @@
                 CallServiceDescriptor oldDescriptor,
                 CallServiceDescriptor newDescriptor);
         void onIncomingCallAnswered(Call call);
-        void onIncomingCallRejected(Call call, boolean rejectWithMessage, String textMessage);
+        void onIncomingCallRejected(Call call);
         void onForegroundCallChanged(Call oldForegroundCall, Call newForegroundCall);
         void onAudioStateChanged(CallAudioState oldAudioState, CallAudioState newAudioState);
         void onRequestingRingback(Call call, boolean ringback);
-        void onIsConferenceCapableChanged(Call call, boolean isConferenceCapable);
-        void onIsConferencedChanged(Call call);
-        void onCannedSmsResponsesLoaded(Call call);
     }
 
     private static final CallsManager INSTANCE = new CallsManager();
@@ -122,7 +119,6 @@
         mListeners.add(app.getMissedCallNotifier());
         mListeners.add(mDtmfLocalTonePlayer);
         mListeners.add(mHeadsetMediaButton);
-        mListeners.add(RespondViaSmsManager.getInstance());
     }
 
     @Override
@@ -169,13 +165,6 @@
     }
 
     @Override
-    public void onIsConferenceCapableChanged(Call call, boolean isConferenceCapable) {
-        for (CallsManagerListener listener : mListeners) {
-            listener.onIsConferenceCapableChanged(call, isConferenceCapable);
-        }
-    }
-
-    @Override
     public void onRequestingRingback(Call call, boolean ringback) {
         for (CallsManagerListener listener : mListeners) {
             listener.onRequestingRingback(call, ringback);
@@ -187,41 +176,6 @@
         mInCallController.onPostDialWait(call, remaining);
     }
 
-    @Override
-    public void onExpiredConferenceCall(Call call) {
-        call.removeListener(this);
-    }
-
-    @Override
-    public void onConfirmedConferenceCall(Call call) {
-        addCall(call);
-        Log.v(this, "confirming Conf call %s", call);
-        for (CallsManagerListener listener : mListeners) {
-            listener.onIsConferencedChanged(call);
-        }
-    }
-
-    @Override
-    public void onParentChanged(Call call) {
-        for (CallsManagerListener listener : mListeners) {
-            listener.onIsConferencedChanged(call);
-        }
-    }
-
-    @Override
-    public void onChildrenChanged(Call call) {
-        for (CallsManagerListener listener : mListeners) {
-            listener.onIsConferencedChanged(call);
-        }
-    }
-
-    @Override
-    public void onCannedSmsResponsesLoaded(Call call) {
-        for (CallsManagerListener listener : mListeners) {
-            listener.onCannedSmsResponsesLoaded(call);
-        }
-    }
-
     ImmutableCollection<Call> getCalls() {
         return ImmutableList.copyOf(mCalls);
     }
@@ -264,7 +218,7 @@
         // Create a call with no handle. Eventually, switchboard will update the call with
         // additional information from the call service, but for now we just need one to pass
         // around.
-        Call call = new Call(true /* isIncoming */, false /* isConference */);
+        Call call = new Call(true /* isIncoming */);
         // TODO(santoscordon): Move this to be a part of addCall()
         call.addListener(this);
 
@@ -289,8 +243,7 @@
                     Log.pii(uriHandle), Log.pii(handle));
         }
 
-        Call call = new Call(
-                uriHandle, gatewayInfo, false /* isIncoming */, false /* isConference */);
+        Call call = new Call(uriHandle, gatewayInfo, false /* isIncoming */);
 
         // TODO(santoscordon): Move this to be a part of addCall()
         call.addListener(this);
@@ -300,17 +253,6 @@
     }
 
     /**
-     * Attempts to start a conference call for the specified call.
-     *
-     * @param call The call to conference with.
-     */
-    void conference(Call call) {
-        Call conferenceCall = new Call(false, true);
-        conferenceCall.addListener(this);
-        call.conferenceInto(conferenceCall);
-    }
-
-    /**
      * Instructs Telecomm to answer the specified call. Intended to be invoked by the in-call
      * app through {@link InCallAdapter} after Telecomm notifies it of an incoming call followed by
      * the user opting to answer said call.
@@ -347,14 +289,14 @@
      * app through {@link InCallAdapter} after Telecomm notifies it of an incoming call followed by
      * the user opting to reject said call.
      */
-    void rejectCall(Call call, boolean rejectWithMessage, String textMessage) {
+    void rejectCall(Call call) {
         if (!mCalls.contains(call)) {
             Log.i(this, "Request to reject a non-existent call %s", call);
         } else {
             for (CallsManagerListener listener : mListeners) {
-                listener.onIncomingCallRejected(call, rejectWithMessage, textMessage);
+                listener.onIncomingCallRejected(call);
             }
-            call.reject(rejectWithMessage, textMessage);
+            call.reject();
         }
     }
 
@@ -468,8 +410,8 @@
         // original call will live on but its state will be updated to the new call's state. In
         // particular the original call's call service will be updated to the new call's call
         // service.
-        Call tempCall = new Call(
-                originalCall.getHandoffHandle(), originalCall.getGatewayInfo(), false, false);
+        Call tempCall =
+                new Call(originalCall.getHandoffHandle(), originalCall.getGatewayInfo(), false);
         tempCall.setOriginalCall(originalCall);
         tempCall.setExtras(originalCall.getExtras());
         tempCall.setCallServiceSelector(originalCall.getCallServiceSelector());
@@ -769,8 +711,9 @@
         handoffCall.removeListener(this);
 
         if (wasSuccessful) {
-            // Disconnect.
-            originalCall.disconnect();
+            if (TelephonyUtil.isCurrentlyPSTNCall(originalCall)) {
+                originalCall.disconnect();
+            }
 
             // Synchronize.
             originalCall.setCallService(handoffCall.getCallService(), handoffCall);
diff --git a/src/com/android/telecomm/CallsManagerListenerBase.java b/src/com/android/telecomm/CallsManagerListenerBase.java
index 55fa0a1..d3ea758 100644
--- a/src/com/android/telecomm/CallsManagerListenerBase.java
+++ b/src/com/android/telecomm/CallsManagerListenerBase.java
@@ -60,7 +60,7 @@
     }
 
     @Override
-    public void onIncomingCallRejected(Call call, boolean rejectWithMessage, String textMessage) {
+    public void onIncomingCallRejected(Call call) {
     }
 
     @Override
@@ -74,16 +74,4 @@
     @Override
     public void onRequestingRingback(Call call, boolean ringback) {
     }
-
-    @Override
-    public void onIsConferenceCapableChanged(Call call, boolean isConferenceCapable) {
-    }
-
-    @Override
-    public void onIsConferencedChanged(Call call) {
-    }
-
-    @Override
-    public void onCannedSmsResponsesLoaded(Call call) {
-    }
 }
diff --git a/src/com/android/telecomm/InCallAdapter.java b/src/com/android/telecomm/InCallAdapter.java
index 7937e95..0dfcae8 100644
--- a/src/com/android/telecomm/InCallAdapter.java
+++ b/src/com/android/telecomm/InCallAdapter.java
@@ -39,118 +39,53 @@
     private static final int MSG_HANDOFF_CALL = 8;
     private static final int MSG_MUTE = 9;
     private static final int MSG_SET_AUDIO_ROUTE = 10;
-    private static final int MSG_CONFERENCE = 11;
-    private static final int MSG_SPLIT_FROM_CONFERENCE = 12;
 
     private final class InCallAdapterHandler extends Handler {
         @Override
         public void handleMessage(Message msg) {
-            Call call;
+            Call call = null;
+            if (msg.obj != null) {
+                call = mCallIdMapper.getCall(msg.obj);
+                if (call == null) {
+                    Log.w(this, "Unknown call id: %s, msg: %d", msg.obj, msg.what);
+                    return;
+                }
+            }
+
             switch (msg.what) {
                 case MSG_ANSWER_CALL:
-                    call = mCallIdMapper.getCall(msg.obj);
-                    if (call != null) {
-                        mCallsManager.answerCall(call);
-                    } else {
-                        Log.w(this, "answerCall, unknown call id: %s", msg.obj);
-                    }
+                    mCallsManager.answerCall(call);
                     break;
                 case MSG_REJECT_CALL:
-                    SomeArgs args = (SomeArgs) msg.obj;
-                    try {
-                        call = mCallIdMapper.getCall(args.arg1);
-                        boolean rejectWithMessage = args.argi1 == 1;
-                        String textMessage = (String) args.arg2;
-                        if (call != null) {
-                            mCallsManager.rejectCall(call, rejectWithMessage, textMessage);
-                        } else {
-                            Log.w(this, "setRingback, unknown call id: %s", args.arg1);
-                        }
-                    } finally {
-                        args.recycle();
-                    }
+                    mCallsManager.rejectCall(call);
                     break;
                 case MSG_PLAY_DTMF_TONE:
-                    call = mCallIdMapper.getCall(msg.obj);
-                    if (call != null) {
-                        mCallsManager.playDtmfTone(call, (char) msg.arg1);
-                    } else {
-                        Log.w(this, "playDtmfTone, unknown call id: %s", msg.obj);
-                    }
+                    mCallsManager.playDtmfTone(call, (char) msg.arg1);
                     break;
                 case MSG_STOP_DTMF_TONE:
-                    call = mCallIdMapper.getCall(msg.obj);
-                    if (call != null) {
-                        mCallsManager.stopDtmfTone(call);
-                    } else {
-                        Log.w(this, "stopDtmfTone, unknown call id: %s", msg.obj);
-                    }
+                    mCallsManager.stopDtmfTone(call);
                     break;
                 case MSG_POST_DIAL_CONTINUE:
-                    call = mCallIdMapper.getCall(msg.obj);
                     mCallsManager.postDialContinue(call, msg.arg1 == 1);
-                    call = mCallIdMapper.getCall(msg.obj);
-                    if (call != null) {
-                        mCallsManager.postDialContinue(call, msg.arg1 == 1);
-                    } else {
-                        Log.w(this, "postDialContinue, unknown call id: %s", msg.obj);
-                    }
                     break;
                 case MSG_DISCONNECT_CALL:
-                    call = mCallIdMapper.getCall(msg.obj);
-                    if (call != null) {
-                        mCallsManager.disconnectCall(call);
-                    } else {
-                        Log.w(this, "disconnectCall, unknown call id: %s", msg.obj);
-                    }
+                    mCallsManager.disconnectCall(call);
                     break;
                 case MSG_HOLD_CALL:
-                    call = mCallIdMapper.getCall(msg.obj);
-                    if (call != null) {
-                        mCallsManager.holdCall(call);
-                    } else {
-                        Log.w(this, "holdCall, unknown call id: %s", msg.obj);
-                    }
+                    mCallsManager.holdCall(call);
                     break;
                 case MSG_UNHOLD_CALL:
-                    call = mCallIdMapper.getCall(msg.obj);
-                    if (call != null) {
-                        mCallsManager.unholdCall(call);
-                    } else {
-                        Log.w(this, "unholdCall, unknown call id: %s", msg.obj);
-                    }
+                    mCallsManager.unholdCall(call);
                     break;
                 case MSG_HANDOFF_CALL:
-                    call = mCallIdMapper.getCall(msg.obj);
-                    if (call != null) {
-                        mCallsManager.startHandoffForCall(call);
-                    } else {
-                        Log.w(this, "startHandoffForCall, unknown call id: %s", msg.obj);
-                    }
+                    mCallsManager.startHandoffForCall(call);
                     break;
                 case MSG_MUTE:
-                    mCallsManager.mute(msg.arg1 == 1);
+                    mCallsManager.mute(msg.arg1 == 1 ? true : false);
                     break;
                 case MSG_SET_AUDIO_ROUTE:
                     mCallsManager.setAudioRoute(msg.arg1);
                     break;
-                case MSG_CONFERENCE:
-                    call = mCallIdMapper.getCall(msg.obj);
-                    if (call != null) {
-                        mCallsManager.conference(call);
-                    } else {
-                        Log.w(this, "conference, unknown call id: %s", msg.obj);
-                    }
-
-                    break;
-                case MSG_SPLIT_FROM_CONFERENCE:
-                    call = mCallIdMapper.getCall(msg.obj);
-                    if (call != null) {
-                        call.splitFromConference();
-                    } else {
-                        Log.w(this, "splitFromConference, unknown call id: %s", msg.obj);
-                    }
-                    break;
             }
         }
     }
@@ -176,14 +111,10 @@
 
     /** {@inheritDoc} */
     @Override
-    public void rejectCall(String callId, boolean rejectWithMessage, String textMessage) {
-        Log.d(this, "rejectCall(%s,%b,%s)", callId, rejectWithMessage, textMessage);
+    public void rejectCall(String callId) {
+        Log.d(this, "rejectCall(%s)", callId);
         mCallIdMapper.checkValidCallId(callId);
-        SomeArgs args = SomeArgs.obtain();
-        args.arg1 = callId;
-        args.argi1 = rejectWithMessage ? 1 : 0;
-        args.arg2 = textMessage;
-        mHandler.obtainMessage(MSG_REJECT_CALL, args).sendToTarget();
+        mHandler.obtainMessage(MSG_REJECT_CALL, callId).sendToTarget();
     }
 
     /** {@inheritDoc} */
@@ -253,13 +184,11 @@
 
     /** ${inheritDoc} */
     @Override
-    public void conference(String callId) {
-        mHandler.obtainMessage(MSG_CONFERENCE, callId).sendToTarget();
+    public void conferenceWith(String arg0, String arg1) {
     }
 
     /** ${inheritDoc} */
     @Override
-    public void splitFromConference(String callId) {
-        mHandler.obtainMessage(MSG_SPLIT_FROM_CONFERENCE, callId).sendToTarget();
+    public void splitFromConference(String arg0) {
     }
 }
diff --git a/src/com/android/telecomm/InCallController.java b/src/com/android/telecomm/InCallController.java
index e519220..637e03e 100644
--- a/src/com/android/telecomm/InCallController.java
+++ b/src/com/android/telecomm/InCallController.java
@@ -23,19 +23,17 @@
 import android.net.Uri;
 import android.os.IBinder;
 import android.os.RemoteException;
+import android.os.UserHandle;
 import android.telecomm.CallAudioState;
 import android.telecomm.CallCapabilities;
 import android.telecomm.CallServiceDescriptor;
 import android.telecomm.CallState;
 import android.telecomm.InCallCall;
+import android.telecomm.CallState;
 
 import com.android.internal.telecomm.IInCallService;
 import com.google.common.collect.ImmutableCollection;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
 /**
  * Binds to {@link IInCallService} and provides the service to {@link CallsManager} through which it
  * can send updates to the in-call app. This class is created and owned by CallsManager and retains
@@ -90,12 +88,10 @@
             bind();
         } else {
             Log.i(this, "Adding call: %s", call);
-            if (mCallIdMapper.getCallId(call) == null) {
-                mCallIdMapper.addCall(call);
-                try {
-                    mInCallService.addCall(toInCallCall(call));
-                } catch (RemoteException ignored) {
-                }
+            mCallIdMapper.addCall(call);
+            try {
+                mInCallService.addCall(toInCallCall(call));
+            } catch (RemoteException ignored) {
             }
         }
     }
@@ -157,22 +153,6 @@
         }
     }
 
-    @Override
-    public void onIsConferenceCapableChanged(Call call, boolean isConferenceCapable) {
-        updateCall(call);
-    }
-
-    @Override
-    public void onIsConferencedChanged(Call call) {
-        Log.v(this, "onIsConferencedChanged %s", call);
-        updateCall(call);
-    }
-
-    @Override
-    public void onCannedSmsResponsesLoaded(Call call) {
-        updateCall(call);
-    }
-
     void bringToForeground(boolean showDialpad) {
         if (mInCallService != null) {
             try {
@@ -211,7 +191,8 @@
             serviceIntent.setComponent(component);
 
             Context context = TelecommApp.getInstance();
-            if (!context.bindService(serviceIntent, mConnection, Context.BIND_AUTO_CREATE)) {
+            if (!context.bindServiceAsUser(serviceIntent, mConnection, Context.BIND_AUTO_CREATE,
+                    UserHandle.CURRENT)) {
                 Log.w(this, "Could not connect to the in-call app (%s)", component);
 
                 // TODO(santoscordon): Implement retry or fall-back-to-default logic.
@@ -262,9 +243,7 @@
     private void updateCall(Call call) {
         if (mInCallService != null) {
             try {
-                InCallCall inCallCall = toInCallCall(call);
-                Log.v(this, "updateCall %s ==> %s", call, inCallCall);
-                mInCallService.updateCall(inCallCall);
+                mInCallService.updateCall(toInCallCall(call));
             } catch (RemoteException ignored) {
             }
         }
@@ -280,9 +259,6 @@
         if (call.getHandoffHandle() != null) {
             capabilities |= CallCapabilities.CONNECTION_HANDOFF;
         }
-        if (call.isConferenceCapable()) {
-            capabilities |= CallCapabilities.MERGE_CALLS;
-        }
         if (CallsManager.getInstance().isAddCallCapable(call)) {
             capabilities |= CallCapabilities.ADD_CALL;
         }
@@ -294,32 +270,9 @@
         if (state == CallState.DISCONNECTED && call.getHandoffCallServiceDescriptor() != null) {
             state = CallState.ACTIVE;
         }
-
-        String parentCallId = null;
-        Call parentCall = call.getParentCall();
-        if (parentCall != null) {
-            parentCallId = mCallIdMapper.getCallId(parentCall);
-        }
-
-        long connectTimeMillis = call.getConnectTimeMillis();
-        List<Call> childCalls = call.getChildCalls();
-        List<String> childCallIds = new ArrayList<>();
-        if (!childCalls.isEmpty()) {
-            connectTimeMillis = Long.MAX_VALUE;
-            for (Call child : childCalls) {
-                connectTimeMillis = Math.min(child.getConnectTimeMillis(), connectTimeMillis);
-                childCallIds.add(mCallIdMapper.getCallId(child));
-            }
-        }
-
-        if (call.isRespondViaSmsCapable()) {
-            capabilities |= CallCapabilities.RESPOND_VIA_TEXT;
-        }
-
         return new InCallCall(callId, state, call.getDisconnectCause(), call.getDisconnectMessage(),
-                call.getCannedSmsResponses(), capabilities, connectTimeMillis, call.getHandle(),
-                call.getGatewayInfo(), descriptor, call.getHandoffCallServiceDescriptor(),
-                parentCallId, childCallIds);
+                capabilities, call.getConnectTimeMillis(), call.getHandle(), call.getGatewayInfo(),
+                descriptor, call.getHandoffCallServiceDescriptor());
     }
 
 }
diff --git a/src/com/android/telecomm/MultiLineTitleEditTextPreference.java b/src/com/android/telecomm/MultiLineTitleEditTextPreference.java
deleted file mode 100644
index d40cb21..0000000
--- a/src/com/android/telecomm/MultiLineTitleEditTextPreference.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.telecomm;
-
-import android.content.Context;
-import android.preference.EditTextPreference;
-import android.util.AttributeSet;
-import android.view.View;
-import android.widget.TextView;
-
-/**
- * Ultra-simple subclass of EditTextPreference that allows the "title" to wrap
- * onto multiple lines.
- *
- * (By default, the title of an EditTextPreference is singleLine="true"; see
- * preference_holo.xml under frameworks/base.  But in the "Respond via SMS"
- * settings UI we want titles to be multi-line, since the customized messages
- * might be fairly long, and should be able to wrap.)
- *
- * TODO: This is pretty cumbersome; it would be nicer for the framework to
- * either allow modifying the title's attributes in XML, or at least provide
- * some way from Java (given an EditTextPreference) to reach inside and get a
- * handle to the "title" TextView.
- *
- * TODO: Also, it would reduce clutter if this could be an inner class in
- * RespondViaSmsManager.java, but then there would be no way to reference the
- * class from XML.  That's because
- *    <com.android.telecomm.MultiLineTitleEditTextPreference ... />
- * isn't valid XML syntax due to the "$" character.  And Preference
- * elements don't have a "class" attribute, so you can't do something like
- * <view class="com.android.telecomm.Foo$Bar"> as you can with regular views.
- */
-public class MultiLineTitleEditTextPreference extends EditTextPreference {
-    public MultiLineTitleEditTextPreference(Context context, AttributeSet attrs, int defStyle) {
-        super(context, attrs, defStyle);
-    }
-
-    public MultiLineTitleEditTextPreference(Context context, AttributeSet attrs) {
-        super(context, attrs);
-    }
-
-    public MultiLineTitleEditTextPreference(Context context) {
-        super(context);
-    }
-
-    // The "title" TextView inside an EditTextPreference defaults to
-    // singleLine="true" (see preference_holo.xml under frameworks/base.)
-    // We override onBindView() purely to look up that TextView and call
-    // setSingleLine(false) on it.
-    @Override
-    protected void onBindView(View view) {
-        super.onBindView(view);
-
-        TextView textView = (TextView) view.findViewById(com.android.internal.R.id.title);
-        if (textView != null) {
-            textView.setSingleLine(false);
-        }
-    }
-}
diff --git a/src/com/android/telecomm/RespondViaSmsManager.java b/src/com/android/telecomm/RespondViaSmsManager.java
deleted file mode 100644
index bf1a2a5..0000000
--- a/src/com/android/telecomm/RespondViaSmsManager.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.telecomm;
-
-import com.android.internal.os.SomeArgs;
-import com.android.internal.telephony.SmsApplication;
-
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.content.res.Resources;
-import android.net.Uri;
-import android.os.Handler;
-import android.os.Message;
-import android.telecomm.Response;
-import android.telephony.TelephonyManager;
-import android.widget.Toast;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Helper class to manage the "Respond via Message" feature for incoming calls.
- */
-public class RespondViaSmsManager extends CallsManagerListenerBase {
-    private static final String SCHEME_SMSTO = "smsto";
-
-    /** SharedPreferences file name for our persistent settings. */
-    private static final String SHARED_PREFERENCES_NAME = "respond_via_sms_prefs";
-
-    // Preference keys for the 4 "canned responses"; see RespondViaSmsManager$Settings.
-    // Since (for now at least) the number of messages is fixed at 4, and since
-    // SharedPreferences can't deal with arrays anyway, just store the messages
-    // as 4 separate strings.
-    private static final int NUM_CANNED_RESPONSES = 4;
-    private static final String KEY_CANNED_RESPONSE_PREF_1 = "canned_response_pref_1";
-    private static final String KEY_CANNED_RESPONSE_PREF_2 = "canned_response_pref_2";
-    private static final String KEY_CANNED_RESPONSE_PREF_3 = "canned_response_pref_3";
-    private static final String KEY_CANNED_RESPONSE_PREF_4 = "canned_response_pref_4";
-
-    private static final int MSG_CANNED_TEXT_MESSAGES_READY = 1;
-    private static final int MSG_SHOW_SENT_TOAST = 2;
-
-    private static final RespondViaSmsManager sInstance = new RespondViaSmsManager();
-
-    private final Handler mHandler = new Handler() {
-        @Override
-        public void handleMessage(Message msg) {
-            switch (msg.what) {
-                case MSG_CANNED_TEXT_MESSAGES_READY:
-                    SomeArgs args = (SomeArgs) msg.obj;
-                    try {
-                        Response<Void, List<String>> response =
-                                (Response<Void, List<String>>) args.arg1;
-                        List<String> textMessages =
-                                (List<String>) args.arg2;
-                        if (textMessages != null) {
-                            response.onResult(null, textMessages);
-                        } else {
-                            response.onError(null, 0, null);
-                        }
-                    } finally {
-                        args.recycle();
-                    }
-                    break;
-                case MSG_SHOW_SENT_TOAST:
-                    showMessageSentToast((String) msg.obj);
-                    break;
-            }
-        }
-    };
-
-    public static RespondViaSmsManager getInstance() { return sInstance; }
-
-    private RespondViaSmsManager() {}
-
-    /**
-     * Read the (customizable) canned responses from SharedPreferences,
-     * or from defaults if the user has never actually brought up
-     * the Settings UI.
-     *
-     * The interface of this method is asynchronous since it does disk I/O.
-     *
-     * @param response An object to receive an async reply, which will be called from
-     *                 the main thread.
-     */
-    public void loadCannedTextMessages(final Response<Void, List<String>> response) {
-        new Thread() {
-            @Override
-            public void run() {
-                Log.d(RespondViaSmsManager.this, "loadCannedResponses() starting");
-                final SharedPreferences prefs = TelecommApp.getInstance().getSharedPreferences(
-                        SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
-                final Resources res = TelecommApp.getInstance().getInstance().getResources();
-
-                final ArrayList<String> textMessages = new ArrayList<String>(NUM_CANNED_RESPONSES);
-
-                // Note the default values here must agree with the corresponding
-                // android:defaultValue attributes in respond_via_sms_settings.xml.
-
-                textMessages.add(0, prefs.getString(KEY_CANNED_RESPONSE_PREF_1,
-                        res.getString(R.string.respond_via_sms_canned_response_1)));
-                textMessages.add(1, prefs.getString(KEY_CANNED_RESPONSE_PREF_2,
-                        res.getString(R.string.respond_via_sms_canned_response_2)));
-                textMessages.add(2, prefs.getString(KEY_CANNED_RESPONSE_PREF_3,
-                        res.getString(R.string.respond_via_sms_canned_response_3)));
-                textMessages.add(3, prefs.getString(KEY_CANNED_RESPONSE_PREF_4,
-                        res.getString(R.string.respond_via_sms_canned_response_4)));
-
-                Log.d(RespondViaSmsManager.this,
-                        "loadCannedResponses() completed, found responses: %s",
-                        textMessages.toString());
-
-                SomeArgs args = SomeArgs.obtain();
-                args.arg1 = response;
-                args.arg2 = textMessages;
-                mHandler.obtainMessage(MSG_CANNED_TEXT_MESSAGES_READY, args).sendToTarget();
-            }
-        }.start();
-    }
-
-    @Override
-    public void onIncomingCallRejected(Call call, boolean rejectWithMessage, String textMessage) {
-        if (rejectWithMessage) {
-            rejectCallWithMessage(call.getHandle().getSchemeSpecificPart(), textMessage);
-        }
-    }
-
-    private void showMessageSentToast(final String phoneNumber) {
-        // ...and show a brief confirmation to the user (since
-        // otherwise it's hard to be sure that anything actually
-        // happened.)
-        final Resources res = TelecommApp.getInstance().getResources();
-        final String formatString = res.getString(
-                R.string.respond_via_sms_confirmation_format);
-        final String confirmationMsg = String.format(formatString, phoneNumber);
-        Toast.makeText(TelecommApp.getInstance(), confirmationMsg,
-                Toast.LENGTH_LONG).show();
-
-        // TODO: If the device is locked, this toast won't actually ever
-        // be visible!  (That's because we're about to dismiss the call
-        // screen, which means that the device will return to the
-        // keyguard.  But toasts aren't visible on top of the keyguard.)
-        // Possible fixes:
-        // (1) Is it possible to allow a specific Toast to be visible
-        //     on top of the keyguard?
-        // (2) Artificially delay the dismissCallScreen() call by 3
-        //     seconds to allow the toast to be seen?
-        // (3) Don't use a toast at all; instead use a transient state
-        //     of the InCallScreen (perhaps via the InCallUiState
-        //     progressIndication feature), and have that state be
-        //     visible for 3 seconds before calling dismissCallScreen().
-    }
-
-    /**
-     * Reject the call with the specified message. If message is null this call is ignored.
-     */
-    private void rejectCallWithMessage(String phoneNumber, String textMessage) {
-        if (textMessage != null) {
-            final ComponentName component =
-                    SmsApplication.getDefaultRespondViaMessageApplication(
-                            TelecommApp.getInstance(), true /*updateIfNeeded*/);
-            if (component != null) {
-                // Build and send the intent
-                final Uri uri = Uri.fromParts(SCHEME_SMSTO, phoneNumber, null);
-                final Intent intent = new Intent(TelephonyManager.ACTION_RESPOND_VIA_MESSAGE, uri);
-                intent.putExtra(Intent.EXTRA_TEXT, textMessage);
-                mHandler.obtainMessage(MSG_SHOW_SENT_TOAST, phoneNumber).sendToTarget();
-                intent.setComponent(component);
-                TelecommApp.getInstance().startService(intent);
-            }
-        }
-    }
-}
diff --git a/src/com/android/telecomm/RespondViaSmsSettings.java b/src/com/android/telecomm/RespondViaSmsSettings.java
deleted file mode 100644
index 1adf45c..0000000
--- a/src/com/android/telecomm/RespondViaSmsSettings.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.telecomm;
-
-import android.app.ActionBar;
-import android.app.Activity;
-import android.content.Context;
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.content.pm.PackageManager;
-import android.os.Bundle;
-import android.preference.EditTextPreference;
-import android.preference.Preference;
-import android.preference.PreferenceActivity;
-import android.view.Menu;
-import android.view.MenuItem;
-
-/**
- * Helper class to manage the "Respond via SMS Message" feature for incoming calls.
- */
-public class RespondViaSmsSettings {
-    /** SharedPreferences file name for our persistent settings. */
-    private static final String SHARED_PREFERENCES_NAME = "respond_via_sms_prefs";
-
-    // Preference keys for the 4 "canned responses"; see RespondViaSmsManager$Settings.
-    // Since (for now at least) the number of messages is fixed at 4, and since
-    // SharedPreferences can't deal with arrays anyway, just store the messages
-    // as 4 separate strings.
-    private static final int NUM_CANNED_RESPONSES = 4;
-    private static final String KEY_CANNED_RESPONSE_PREF_1 = "canned_response_pref_1";
-    private static final String KEY_CANNED_RESPONSE_PREF_2 = "canned_response_pref_2";
-    private static final String KEY_CANNED_RESPONSE_PREF_3 = "canned_response_pref_3";
-    private static final String KEY_CANNED_RESPONSE_PREF_4 = "canned_response_pref_4";
-    private static final String KEY_PREFERRED_PACKAGE = "preferred_package_pref";
-    private static final String KEY_INSTANT_TEXT_DEFAULT_COMPONENT = "instant_text_def_component";
-
-    // TODO: This class is newly copied into Telecomm (com.android.telecomm) from it previous
-    // location in Telephony (com.android.phone). User's preferences stored in the old location
-    // will be lost. We need code here to migrate KLP -> LMP settings values.
-
-    /**
-     * Settings activity under "Call settings" to let you manage the
-     * canned responses; see respond_via_sms_settings.xml
-     */
-    public static class Settings extends PreferenceActivity
-            implements Preference.OnPreferenceChangeListener {
-        @Override
-        protected void onCreate(Bundle icicle) {
-            super.onCreate(icicle);
-            Log.d(this, "Settings: onCreate()...");
-
-            getPreferenceManager().setSharedPreferencesName(SHARED_PREFERENCES_NAME);
-
-            // This preference screen is ultra-simple; it's just 4 plain
-            // <EditTextPreference>s, one for each of the 4 "canned responses".
-            //
-            // The only nontrivial thing we do here is copy the text value of
-            // each of those EditTextPreferences and use it as the preference's
-            // "title" as well, so that the user will immediately see all 4
-            // strings when they arrive here.
-            //
-            // Also, listen for change events (since we'll need to update the
-            // title any time the user edits one of the strings.)
-
-            addPreferencesFromResource(R.xml.respond_via_sms_settings);
-
-            EditTextPreference pref;
-            pref = (EditTextPreference) findPreference(KEY_CANNED_RESPONSE_PREF_1);
-            pref.setTitle(pref.getText());
-            pref.setOnPreferenceChangeListener(this);
-
-            pref = (EditTextPreference) findPreference(KEY_CANNED_RESPONSE_PREF_2);
-            pref.setTitle(pref.getText());
-            pref.setOnPreferenceChangeListener(this);
-
-            pref = (EditTextPreference) findPreference(KEY_CANNED_RESPONSE_PREF_3);
-            pref.setTitle(pref.getText());
-            pref.setOnPreferenceChangeListener(this);
-
-            pref = (EditTextPreference) findPreference(KEY_CANNED_RESPONSE_PREF_4);
-            pref.setTitle(pref.getText());
-            pref.setOnPreferenceChangeListener(this);
-
-            ActionBar actionBar = getActionBar();
-            if (actionBar != null) {
-                // android.R.id.home will be triggered in onOptionsItemSelected()
-                actionBar.setDisplayHomeAsUpEnabled(true);
-            }
-        }
-
-        // Preference.OnPreferenceChangeListener implementation
-        @Override
-        public boolean onPreferenceChange(Preference preference, Object newValue) {
-            Log.d(this, "onPreferenceChange: key = %s", preference.getKey());
-            Log.d(this, "  preference = '%s'", preference);
-            Log.d(this, "  newValue = '%s'", newValue);
-
-            EditTextPreference pref = (EditTextPreference) preference;
-
-            // Copy the new text over to the title, just like in onCreate().
-            // (Watch out: onPreferenceChange() is called *before* the
-            // Preference itself gets updated, so we need to use newValue here
-            // rather than pref.getText().)
-            pref.setTitle((String) newValue);
-
-            return true;  // means it's OK to update the state of the Preference with the new value
-        }
-
-        @Override
-        public boolean onOptionsItemSelected(MenuItem item) {
-            final int itemId = item.getItemId();
-            switch (itemId) {
-                case android.R.id.home:
-                    goUpToTopLevelSetting(this);
-                    return true;
-                case R.id.respond_via_message_reset:
-                    // Reset the preferences settings
-                    SharedPreferences prefs = getSharedPreferences(
-                            SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
-                    SharedPreferences.Editor editor = prefs.edit();
-                    editor.remove(KEY_INSTANT_TEXT_DEFAULT_COMPONENT);
-                    editor.apply();
-
-                    return true;
-                default:
-            }
-            return super.onOptionsItemSelected(item);
-        }
-
-        @Override
-        public boolean onCreateOptionsMenu(Menu menu) {
-            getMenuInflater().inflate(R.menu.respond_via_message_settings_menu, menu);
-            return super.onCreateOptionsMenu(menu);
-        }
-    }
-
-    /**
-     * Finish current Activity and go up to the top level Settings.
-     */
-    public static void goUpToTopLevelSetting(Activity activity) {
-        Intent intent = new Intent();
-        try {
-            intent.setClassName(
-                    activity.createPackageContext("com.android.phone", 0),
-                    "com.android.phone.CallFeaturesSetting");
-        } catch (PackageManager.NameNotFoundException e) {
-            Log.w(RespondViaSmsSettings.class,
-                    "Exception building package context com.android.phone", e);
-            return;
-        }
-        intent.setAction(Intent.ACTION_MAIN);
-        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
-        activity.startActivity(intent);
-        activity.finish();
-     }
-}
diff --git a/src/com/android/telecomm/Ringer.java b/src/com/android/telecomm/Ringer.java
index 0b54a2b..5b5beff 100644
--- a/src/com/android/telecomm/Ringer.java
+++ b/src/com/android/telecomm/Ringer.java
@@ -105,7 +105,7 @@
     }
 
     @Override
-    public void onIncomingCallRejected(Call call, boolean rejectWithMessage, String textMessage) {
+    public void onIncomingCallRejected(Call call) {
         onRespondedToIncomingCall(call);
     }
 
diff --git a/src/com/android/telecomm/TelecommApp.java b/src/com/android/telecomm/TelecommApp.java
index 48f6ba5..7f477f9 100644
--- a/src/com/android/telecomm/TelecommApp.java
+++ b/src/com/android/telecomm/TelecommApp.java
@@ -17,6 +17,7 @@
 package com.android.telecomm;
 
 import android.app.Application;
+import android.os.UserHandle;
 
 /**
  * Top-level Application class for Telecomm.
@@ -38,7 +39,9 @@
         sInstance = this;
 
         mMissedCallNotifier = new MissedCallNotifier(this);
-        TelecommServiceImpl.init();
+        if (UserHandle.myUserId() == UserHandle.USER_OWNER) {
+            TelecommServiceImpl.init();
+        }
     }
 
     public static TelecommApp getInstance() {
diff --git a/src/com/android/telecomm/Timeouts.java b/src/com/android/telecomm/Timeouts.java
index 3e5899c..d13091f 100644
--- a/src/com/android/telecomm/Timeouts.java
+++ b/src/com/android/telecomm/Timeouts.java
@@ -65,14 +65,7 @@
      * to complete. If the query goes beyond this timeout, the incoming call screen is shown to the
      * user.
      */
-    public static long getDirectToVoicemailMillis() {
+    public static long getDirectToVoicemail() {
         return get("direct_to_voicemail_ms", 500L);
     }
-
-    /**
-     * Returns the amount of time that a connection service has to respond to a "conference" action.
-     */
-    public static long getConferenceCallExpireMillis() {
-        return get("conference_call_expire_ms", 15 * 1000L);
-    }
 }
diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml
index 570b2ae..807e669 100644
--- a/tests/AndroidManifest.xml
+++ b/tests/AndroidManifest.xml
@@ -16,31 +16,32 @@
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
         package="com.android.telecomm.tests">
+
     <application android:label="@string/app_name">
         <uses-library android:name="android.test.runner" />
 
         <!-- Miscellaneous telecomm app-related test activities. -->
 
         <!-- TODO(santoscordon): STOPSHIP Services in this manifest need permission protection. -->
-        <service android:name="com.android.telecomm.testcallservice.TestCallServiceProvider">
+        <service android:name="com.android.telecomm.testapps.TestCallServiceProvider">
             <intent-filter>
                 <action android:name="android.telecomm.CallServiceProvider" />
             </intent-filter>
         </service>
 
-        <service android:name="com.android.telecomm.testcallservice.TestCallService">
+        <service android:name="com.android.telecomm.testapps.TestCallService">
             <intent-filter>
                 <action android:name="android.telecomm.CallService" />
             </intent-filter>
         </service>
 
-        <service android:name="com.android.telecomm.testcallservice.DummyCallServiceSelector">
+        <service android:name="com.android.telecomm.testapps.DummyCallServiceSelector">
             <intent-filter>
                 <action android:name="android.telecomm.CallServiceSelector" />
             </intent-filter>
         </service>
 
-        <activity android:name="com.android.telecomm.testcallservice.TestCallActivity"
+        <activity android:name="com.android.telecomm.testapps.TestCallActivity"
                 android:label="@string/testCallActivityLabel">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
@@ -49,14 +50,48 @@
             </intent-filter>
         </activity>
 
-        <receiver android:name="com.android.telecomm.testcallservice.CallNotificationReceiver"
+        <receiver android:name="com.android.telecomm.testapps.CallNotificationReceiver"
                 android:exported="false">
             <intent-filter>
-                <action android:name="com.android.telecomm.testcallservice.ACTION_CALL_SERVICE_EXIT"
+                <action android:name="com.android.telecomm.testapps.ACTION_CALL_SERVICE_EXIT"
                 />
             </intent-filter>
         </receiver>
 
+        <activity android:name="com.android.telecomm.testapps.TestDialerActivity"
+                android:label="@string/testDialerActivityLabel" >
+            <intent-filter>
+                <action android:name="android.intent.action.DIAL" />
+                <category android:name="android.intent.category.DEFAULT" />
+                <category android:name="android.intent.category.BROWSABLE" />
+                <data android:mimeType="vnd.android.cursor.item/phone" />
+                <data android:mimeType="vnd.android.cursor.item/person" />
+            </intent-filter>
+            <intent-filter>
+                <action android:name="android.intent.action.DIAL" />
+                <category android:name="android.intent.category.DEFAULT" />
+                <category android:name="android.intent.category.BROWSABLE" />
+                <data android:scheme="voicemail" />
+            </intent-filter>
+            <intent-filter>
+                <action android:name="android.intent.action.DIAL" />
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+            <intent-filter>
+                <action android:name="android.intent.action.VIEW" />
+                <action android:name="android.intent.action.DIAL" />
+                <category android:name="android.intent.category.DEFAULT" />
+                <category android:name="android.intent.category.BROWSABLE" />
+                <data android:scheme="tel" />
+            </intent-filter>
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.DEFAULT" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+
+
     </application>
 
     <!--
diff --git a/tests/res/layout/testdialer_main.xml b/tests/res/layout/testdialer_main.xml
new file mode 100644
index 0000000..a5453fc
--- /dev/null
+++ b/tests/res/layout/testdialer_main.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical" >
+    <EditText
+        android:id="@+id/number"
+        android:inputType="number"
+        android:layout_width="200dp"
+        android:layout_height="wrap_content" />
+    <Button
+        android:id="@+id/place_call_button"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/placeCallButton" />
+    <Button
+        android:id="@+id/set_default_button"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/defaultDialerButton" />
+</LinearLayout>
diff --git a/tests/res/values/donottranslate_strings.xml b/tests/res/values/donottranslate_strings.xml
index 6e4788f..76d8777 100644
--- a/tests/res/values/donottranslate_strings.xml
+++ b/tests/res/values/donottranslate_strings.xml
@@ -20,4 +20,13 @@
 
     <!-- String for the TestCallActivity -->
     <string name="testCallActivityLabel">Test CallService App</string>
+
+    <!-- String for the TestDialerActivity -->
+    <string name="testDialerActivityLabel">Test Dialer</string>
+
+    <!-- String for button in TestDialerActivity that reassigns the default Dialer -->
+    <string name="defaultDialerButton">Default dialer request</string>
+
+    <!-- String for button in TestDialerActivity that places a test call -->
+    <string name="placeCallButton">Place call</string>
 </resources>
diff --git a/tests/src/com/android/telecomm/testcallservice/CallNotificationReceiver.java b/tests/src/com/android/telecomm/testapps/CallNotificationReceiver.java
similarity index 96%
rename from tests/src/com/android/telecomm/testcallservice/CallNotificationReceiver.java
rename to tests/src/com/android/telecomm/testapps/CallNotificationReceiver.java
index 5e74069..4ab908f 100644
--- a/tests/src/com/android/telecomm/testcallservice/CallNotificationReceiver.java
+++ b/tests/src/com/android/telecomm/testapps/CallNotificationReceiver.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.telecomm.testcallservice;
+package com.android.telecomm.testapps;
 
 import android.content.BroadcastReceiver;
 import android.content.Context;
diff --git a/tests/src/com/android/telecomm/testcallservice/CallServiceNotifier.java b/tests/src/com/android/telecomm/testapps/CallServiceNotifier.java
similarity index 98%
rename from tests/src/com/android/telecomm/testcallservice/CallServiceNotifier.java
rename to tests/src/com/android/telecomm/testapps/CallServiceNotifier.java
index e88c293..336ce56 100644
--- a/tests/src/com/android/telecomm/testcallservice/CallServiceNotifier.java
+++ b/tests/src/com/android/telecomm/testapps/CallServiceNotifier.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.telecomm.testcallservice;
+package com.android.telecomm.testapps;
 
 import android.app.Notification;
 import android.app.NotificationManager;
diff --git a/tests/src/com/android/telecomm/testcallservice/DummyCallServiceSelector.java b/tests/src/com/android/telecomm/testapps/DummyCallServiceSelector.java
similarity index 98%
rename from tests/src/com/android/telecomm/testcallservice/DummyCallServiceSelector.java
rename to tests/src/com/android/telecomm/testapps/DummyCallServiceSelector.java
index 28085ea..5f0db05 100644
--- a/tests/src/com/android/telecomm/testcallservice/DummyCallServiceSelector.java
+++ b/tests/src/com/android/telecomm/testapps/DummyCallServiceSelector.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.telecomm.testcallservice;
+package com.android.telecomm.testapps;
 
 import android.net.Uri;
 import android.os.Bundle;
diff --git a/tests/src/com/android/telecomm/testcallservice/TestCallActivity.java b/tests/src/com/android/telecomm/testapps/TestCallActivity.java
similarity index 96%
rename from tests/src/com/android/telecomm/testcallservice/TestCallActivity.java
rename to tests/src/com/android/telecomm/testapps/TestCallActivity.java
index 5c483ef..9752252 100644
--- a/tests/src/com/android/telecomm/testcallservice/TestCallActivity.java
+++ b/tests/src/com/android/telecomm/testapps/TestCallActivity.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.telecomm.testcallservice;
+package com.android.telecomm.testapps;
 
 import android.app.Activity;
 import android.os.Bundle;
diff --git a/tests/src/com/android/telecomm/testcallservice/TestCallService.java b/tests/src/com/android/telecomm/testapps/TestCallService.java
similarity index 96%
rename from tests/src/com/android/telecomm/testcallservice/TestCallService.java
rename to tests/src/com/android/telecomm/testapps/TestCallService.java
index b179849..d34a2d2 100644
--- a/tests/src/com/android/telecomm/testcallservice/TestCallService.java
+++ b/tests/src/com/android/telecomm/testapps/TestCallService.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.telecomm.testcallservice;
+package com.android.telecomm.testapps;
 
 import android.content.Intent;
 import android.media.MediaPlayer;
@@ -185,12 +185,12 @@
 
     /** ${inheritDoc} */
     @Override
-    public void conference(String conferenceCallId, String callId) {
+    public void addToConference(String conferenceCallId, List<String> callIds) {
     }
 
     /** ${inheritDoc} */
     @Override
-    public void splitFromConference(String callId) {
+    public void splitFromConference(String conferenceCallId, String callId) {
     }
 
     private void activateCall(String callId) {
diff --git a/tests/src/com/android/telecomm/testcallservice/TestCallServiceProvider.java b/tests/src/com/android/telecomm/testapps/TestCallServiceProvider.java
similarity index 96%
rename from tests/src/com/android/telecomm/testcallservice/TestCallServiceProvider.java
rename to tests/src/com/android/telecomm/testapps/TestCallServiceProvider.java
index 3a6646c..a8ccaa1 100644
--- a/tests/src/com/android/telecomm/testcallservice/TestCallServiceProvider.java
+++ b/tests/src/com/android/telecomm/testapps/TestCallServiceProvider.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.telecomm.testcallservice;
+package com.android.telecomm.testapps;
 
 import android.telecomm.CallServiceDescriptor;
 import android.telecomm.CallServiceLookupResponse;
diff --git a/tests/src/com/android/telecomm/testapps/TestDialerActivity.java b/tests/src/com/android/telecomm/testapps/TestDialerActivity.java
new file mode 100644
index 0000000..405bca5
--- /dev/null
+++ b/tests/src/com/android/telecomm/testapps/TestDialerActivity.java
@@ -0,0 +1,56 @@
+package com.android.telecomm.testapps;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.EditText;
+
+import com.android.telecomm.tests.R;
+
+public class TestDialerActivity extends Activity {
+    private EditText mNumberView;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.testdialer_main);
+        findViewById(R.id.set_default_button).setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                setDefault();
+            }
+        });
+        findViewById(R.id.place_call_button).setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                placeCall();
+            }
+        });
+
+        mNumberView = (EditText) findViewById(R.id.number);
+        updateEditTextWithNumber();
+    }
+
+    @Override
+    protected void onNewIntent(Intent intent) {
+        super.onNewIntent(intent);
+        updateEditTextWithNumber();
+    }
+
+    private void updateEditTextWithNumber() {
+        Intent intent = getIntent();
+        if (intent != null) {
+            mNumberView.setText(intent.getDataString());
+        }
+    }
+
+    private void setDefault() {
+        // TODO: Send a request to become the default dialer application
+    }
+
+    private void placeCall() {
+        // TODO: Place a call with the number entered in the number field
+    }
+}
