diff --git a/res/values-my-rMM/strings.xml b/res/values-my-rMM/strings.xml
index ea4bbe5..38c475a 100644
--- a/res/values-my-rMM/strings.xml
+++ b/res/values-my-rMM/strings.xml
@@ -36,8 +36,8 @@
     <string name="respond_via_sms_edittext_dialog_title" msgid="20379890418289778">"အမြန်တုံ့ပြန်ချက်"</string>
     <string name="respond_via_sms_menu_reset_default_activity" msgid="1461742052902053466">"ပုံသေ အပ်ပလီကေးရှင်းအား ပြန်ပြောင်းရန်"</string>
     <string name="respond_via_sms_confirmation_format" msgid="7229149977515784269">"<xliff:g id="PHONE_NUMBER">%s</xliff:g> ထံ စာတိုပို့လိုက်ပါပြီ"</string>
-    <string name="outgoing_call_not_allowed" msgid="1435394568102165287">"အရေးပေါ်ဖုန်းများကိုသာ ခေါ်ဆိုနိုင်ရန် စက်ကိရိယာပိုင်ရှင်က ခွင့်ပြုထား၏"</string>
-    <string name="outgoing_call_error_no_phone_number_supplied" msgid="1940125199802007505">"ဖုန်းခေါ်ရန်အတွက်၊ သင့်လျော်သည့်နံပါတ် ရိုက်ထည့်ပါ။"</string>
+    <string name="outgoing_call_not_allowed" msgid="1435394568102165287">"အရေးပေါ်ဖုန်းများကိုသာ ခေါ်ဆိုနိုင်ရန် စက်ကိရိယာပိုင်ရှင်က ခွင့်ပြုထား၏"</string>
+    <string name="outgoing_call_error_no_phone_number_supplied" msgid="1940125199802007505">"ဖုန်းခေါ်ရန်အတွက်၊ သင့်လျော်သည့်နံပါတ် ရိုက်ထည့်ပါ။"</string>
     <string name="duplicate_video_call_not_allowed" msgid="3749211605014548386">"ဗွီဒီယိုခေါ်နေစဉ် ထပ်ခေါ်မရပါ။"</string>
     <string name="no_vm_number" msgid="4164780423805688336">"အသံစာပို့စနစ် နံပါတ် ပျောက်နေပါသည်"</string>
     <string name="no_vm_number_msg" msgid="1300729501030053828">"ဆင်းမ်ကဒ်ပေါ်တွင် အသံစာပို့စနစ် နံပါတ် သိမ်းဆည်ထားခြင်း မရှိပါ"</string>
diff --git a/src/com/android/server/telecom/Call.java b/src/com/android/server/telecom/Call.java
index 19b7fdb..d3eddb5 100644
--- a/src/com/android/server/telecom/Call.java
+++ b/src/com/android/server/telecom/Call.java
@@ -331,6 +331,13 @@
             boolean isIncoming,
             boolean isConference) {
         mState = isConference ? CallState.ACTIVE : CallState.NEW;
+
+        // Conference calls are considered connected upon adding to Telecom, so set the connect
+        // time now.
+        if (isConference) {
+            mConnectTimeMillis = System.currentTimeMillis();
+        }
+
         mContext = context;
         mRepository = repository;
         setHandle(handle);
@@ -385,7 +392,18 @@
     void setState(int newState) {
         if (mState != newState) {
             Log.v(this, "setState %s -> %s", mState, newState);
-            int oldState = mState;
+
+            if (newState == CallState.DISCONNECTED
+                    && (mState == CallState.DIALING || mState == CallState.CONNECTING)
+                    && mCreateConnectionProcessor != null
+                    && mCreateConnectionProcessor.isProcessingComplete()
+                    && mCreateConnectionProcessor.hasMorePhoneAccounts()
+                    && mDisconnectCause != null
+                    && mDisconnectCause.getCode() == DisconnectCause.ERROR) {
+                mCreateConnectionProcessor.continueProcessingIfPossible(this, mDisconnectCause);
+                return;
+            }
+
             mState = newState;
             maybeLoadCannedSmsResponses();
 
@@ -403,14 +421,6 @@
                 mDisconnectTimeMillis = System.currentTimeMillis();
                 setLocallyDisconnecting(false);
                 fixParentAfterDisconnect();
-                if ((oldState == CallState.DIALING || oldState == CallState.CONNECTING)
-                        && mCreateConnectionProcessor != null
-                        && mCreateConnectionProcessor.isProcessingComplete()
-                        && mCreateConnectionProcessor.hasMorePhoneAccounts()
-                        && mDisconnectCause != null
-                        && mDisconnectCause.getCode() == DisconnectCause.ERROR) {
-                    mCreateConnectionProcessor.continueProcessingIfPossible(this, mDisconnectCause);
-                }
             }
         }
     }
diff --git a/src/com/android/server/telecom/CallActivity.java b/src/com/android/server/telecom/CallActivity.java
index 0d57b54..5ce0eb7 100644
--- a/src/com/android/server/telecom/CallActivity.java
+++ b/src/com/android/server/telecom/CallActivity.java
@@ -124,13 +124,7 @@
 
         intent.putExtra(CallReceiver.KEY_IS_DEFAULT_DIALER, isDefaultDialer());
 
-        if (UserHandle.myUserId() == UserHandle.USER_OWNER) {
-            Trace.beginSection("processOutgoingCallIntent");
-            CallReceiver.processOutgoingCallIntent(getApplicationContext(), intent);
-            Trace.endSection();
-        } else {
-            sendBroadcastToReceiver(intent, false /* isIncoming */);
-        }
+        sendBroadcastToReceiver(intent);
     }
 
     private boolean isDefaultDialer() {
@@ -159,11 +153,11 @@
     /**
      * Trampolines the intent to the broadcast receiver that runs only as the primary user.
      */
-    private boolean sendBroadcastToReceiver(Intent intent, boolean incoming) {
-        intent.putExtra(CallReceiver.KEY_IS_INCOMING_CALL, incoming);
+    private boolean sendBroadcastToReceiver(Intent intent) {
+        intent.putExtra(CallReceiver.KEY_IS_INCOMING_CALL, false);
         intent.setFlags(Intent.FLAG_RECEIVER_FOREGROUND);
         intent.setClass(this, CallReceiver.class);
-        Log.d(this, "Sending broadcast as user to CallReceiver- isIncoming: %s", incoming);
+        Log.d(this, "Sending broadcast as user to CallReceiver");
         sendBroadcastAsUser(intent, UserHandle.OWNER);
         return true;
     }
diff --git a/src/com/android/server/telecom/CallAudioManager.java b/src/com/android/server/telecom/CallAudioManager.java
index b7d1b19..cc948e4 100644
--- a/src/com/android/server/telecom/CallAudioManager.java
+++ b/src/com/android/server/telecom/CallAudioManager.java
@@ -339,9 +339,17 @@
         if (mIsRinging) {
             requestAudioFocusAndSetMode(AudioManager.STREAM_RING, AudioManager.MODE_RINGTONE);
         } else {
-            Call call = getForegroundCall();
-            if (call != null) {
-                int mode = call.getIsVoipAudioMode() ?
+            Call foregroundCall = getForegroundCall();
+            Call waitingForAccountSelectionCall =
+                    CallsManager.getInstance().getFirstCallWithState(CallState.PRE_DIAL_WAIT);
+            if (foregroundCall != null && waitingForAccountSelectionCall == null) {
+                // In the case where there is a call that is waiting for account selection,
+                // this will fall back to abandonAudioFocus() below, which temporarily exits
+                // the in-call audio mode. This is to allow TalkBack to speak the "Call with"
+                // dialog information at media volume as opposed to through the earpiece.
+                // Once exiting the "Call with" dialog, the audio focus will return to an in-call
+                // audio mode when this method (updateAudioStreamAndMode) is called again.
+                int mode = foregroundCall.getIsVoipAudioMode() ?
                         AudioManager.MODE_IN_COMMUNICATION : AudioManager.MODE_IN_CALL;
                 requestAudioFocusAndSetMode(AudioManager.STREAM_VOICE_CALL, mode);
             } else if (mIsTonePlaying) {
@@ -363,7 +371,8 @@
     }
 
     private void requestAudioFocusAndSetMode(int stream, int mode) {
-        Log.i(this, "requestAudioFocusAndSetMode, stream: %d -> %d", mAudioFocusStreamType, stream);
+        Log.i(this, "requestAudioFocusAndSetMode, stream: %d -> %d, mode: %d",
+                mAudioFocusStreamType, stream, mode);
         Preconditions.checkState(stream != STREAM_NONE);
 
         // Even if we already have focus, if the stream is different we update audio manager to give
@@ -490,8 +499,9 @@
         // We ignore any foreground call that is in the ringing state because we deal with ringing
         // calls exclusively through the mIsRinging variable set by {@link Ringer}.
         if (call != null && call.getState() == CallState.RINGING) {
-            call = null;
+            return null;
         }
+
         return call;
     }
 
diff --git a/src/com/android/server/telecom/CallReceiver.java b/src/com/android/server/telecom/CallReceiver.java
index 8654b7f..27d4f51 100644
--- a/src/com/android/server/telecom/CallReceiver.java
+++ b/src/com/android/server/telecom/CallReceiver.java
@@ -5,6 +5,7 @@
 import android.content.Intent;
 import android.net.Uri;
 import android.os.Bundle;
+import android.os.Trace;
 import android.os.UserHandle;
 import android.telecom.PhoneAccount;
 import android.telecom.PhoneAccountHandle;
@@ -33,11 +34,13 @@
         final boolean isUnknownCall = intent.getBooleanExtra(KEY_IS_UNKNOWN_CALL, false);
         Log.i(this, "onReceive - isUnknownCall: %s", isUnknownCall);
 
+        Trace.beginSection("processNewCallCallIntent");
         if (isUnknownCall) {
             processUnknownCallIntent(intent);
         } else {
             processOutgoingCallIntent(context, intent);
         }
+        Trace.endSection();
     }
 
     /**
diff --git a/src/com/android/server/telecom/CallsManager.java b/src/com/android/server/telecom/CallsManager.java
index 1697d38..602ab4b 100644
--- a/src/com/android/server/telecom/CallsManager.java
+++ b/src/com/android/server/telecom/CallsManager.java
@@ -109,6 +109,7 @@
     private final InCallController mInCallController;
     private final CallAudioManager mCallAudioManager;
     private final Ringer mRinger;
+    private final InCallWakeLockController mInCallWakeLockController;
     // For this set initial table size to 16 because we add 13 listeners in
     // the CallsManager constructor.
     private final Set<CallsManagerListener> mListeners = Collections.newSetFromMap(
@@ -171,6 +172,7 @@
         mDtmfLocalTonePlayer = new DtmfLocalTonePlayer(context);
         mConnectionServiceRepository = new ConnectionServiceRepository(mPhoneAccountRegistrar,
                 context);
+        mInCallWakeLockController = new InCallWakeLockController(context, this);
 
         mListeners.add(statusBarNotifier);
         mListeners.add(mCallLogManager);
@@ -412,13 +414,19 @@
     private Call getNewOutgoingCall(Uri handle) {
         // First check to see if we can reuse any of the calls that are waiting to disconnect.
         // See {@link Call#abort} and {@link #onCanceledViaNewOutgoingCall} for more information.
+        Call reusedCall = null;
         for (Call pendingCall : mPendingCallsToDisconnect) {
-            if (Objects.equals(pendingCall.getHandle(), handle)) {
+            if (reusedCall == null && Objects.equals(pendingCall.getHandle(), handle)) {
                 mPendingCallsToDisconnect.remove(pendingCall);
                 Log.i(this, "Reusing disconnected call %s", pendingCall);
-                return pendingCall;
+                reusedCall = pendingCall;
+            } else {
+                pendingCall.disconnect();
             }
         }
+        if (reusedCall != null) {
+            return reusedCall;
+        }
 
         // Create a call with original handle. The handle may be changed when the call is attached
         // to a connection service, but in most cases will remain the same.
@@ -484,6 +492,7 @@
         // a call, or cancel this call altogether.
         if (!isPotentialInCallMMICode && !makeRoomForOutgoingCall(call, isEmergencyCall)) {
             // just cancel at this point.
+            Log.i(this, "No remaining room for outgoing call: %s", call);
             if (mCalls.contains(call)) {
                 // This call can already exist if it is a reused call,
                 // See {@link #getNewOutgoingCall}.
@@ -895,6 +904,10 @@
      * Returns true if telecom supports adding another top-level call.
      */
     boolean canAddCall() {
+        if (getFirstCallWithState(OUTGOING_CALL_STATES) != null) {
+            return false;
+        }
+
         int count = 0;
         for (Call call : mCalls) {
             if (call.isEmergencyCall()) {
diff --git a/src/com/android/server/telecom/InCallController.java b/src/com/android/server/telecom/InCallController.java
index bc0e315..b77dd14 100644
--- a/src/com/android/server/telecom/InCallController.java
+++ b/src/com/android/server/telecom/InCallController.java
@@ -39,8 +39,6 @@
 import android.telecom.TelecomManager;
 import android.util.ArrayMap;
 
-
-
 // TODO: Needed for move to system service: import com.android.internal.R;
 import com.android.internal.telecom.IInCallService;
 import com.android.internal.util.IndentingPrintWriter;
@@ -154,7 +152,7 @@
     @Override
     public void onCallAdded(Call call) {
         if (mInCallServices.isEmpty()) {
-            bind();
+            bind(call);
         } else {
             Log.i(this, "onCallAdded: %s", call);
             // Track the call if we don't already know about it.
@@ -274,8 +272,10 @@
     /**
      * Binds to the in-call app if not already connected by binding directly to the saved
      * component name of the {@link IInCallService} implementation.
+     *
+     * @param call The newly added call that triggered the binding to the in-call services.
      */
-    private void bind() {
+    private void bind(Call call) {
         ThreadUtil.checkOnMainThread();
         if (mInCallServices.isEmpty()) {
             PackageManager packageManager = mContext.getPackageManager();
@@ -316,9 +316,19 @@
                         Intent intent = new Intent(InCallService.SERVICE_INTERFACE);
                         intent.setComponent(componentName);
 
-                        final int bindFlags = mInCallComponentName.equals(componentName)
-                                ? Context.BIND_AUTO_CREATE | Context.BIND_IMPORTANT
-                                : Context.BIND_AUTO_CREATE;
+                        final int bindFlags;
+                        if (mInCallComponentName.equals(componentName)) {
+                            bindFlags = Context.BIND_AUTO_CREATE | Context.BIND_IMPORTANT;
+                            if (!call.isIncoming()) {
+                                intent.putExtra(TelecomManager.EXTRA_OUTGOING_CALL_EXTRAS,
+                                        call.getExtras());
+                                intent.putExtra(TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE,
+                                        call.getTargetPhoneAccount());
+                            }
+                        } else {
+                            bindFlags = Context.BIND_AUTO_CREATE;
+                        }
+
                         if (mContext.bindServiceAsUser(intent, inCallServiceConnection, bindFlags,
                                 UserHandle.CURRENT)) {
                             mServiceConnections.put(componentName, inCallServiceConnection);
@@ -493,13 +503,18 @@
         List<Call> childCalls = call.getChildCalls();
         List<String> childCallIds = new ArrayList<>();
         if (!childCalls.isEmpty()) {
-            connectTimeMillis = Long.MAX_VALUE;
+            long childConnectTimeMillis = Long.MAX_VALUE;
             for (Call child : childCalls) {
                 if (child.getConnectTimeMillis() > 0) {
-                    connectTimeMillis = Math.min(child.getConnectTimeMillis(), connectTimeMillis);
+                    childConnectTimeMillis = Math.min(child.getConnectTimeMillis(),
+                            childConnectTimeMillis);
                 }
                 childCallIds.add(mCallIdMapper.getCallId(child));
             }
+
+            if (childConnectTimeMillis != Long.MAX_VALUE) {
+                connectTimeMillis = childConnectTimeMillis;
+            }
         }
 
         Uri handle = call.getHandlePresentation() == TelecomManager.PRESENTATION_ALLOWED ?
@@ -582,6 +597,9 @@
 
         Connection.CAPABILITY_DISCONNECT_FROM_CONFERENCE,
         android.telecom.Call.Details.CAPABILITY_DISCONNECT_FROM_CONFERENCE,
+
+        Connection.CAPABILITY_GENERIC_CONFERENCE,
+        android.telecom.Call.Details.CAPABILITY_GENERIC_CONFERENCE
     };
 
     private static int convertConnectionToCallCapabilities(int connectionCapabilities) {
diff --git a/src/com/android/server/telecom/InCallWakeLockController.java b/src/com/android/server/telecom/InCallWakeLockController.java
new file mode 100644
index 0000000..d97e171
--- /dev/null
+++ b/src/com/android/server/telecom/InCallWakeLockController.java
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ */
+
+package com.android.server.telecom;
+
+import android.content.Context;
+import android.os.PowerManager;
+import android.telecom.CallState;
+
+/**
+ * Handles acquisition and release of wake locks relating to call state.
+ */
+class InCallWakeLockController extends CallsManagerListenerBase {
+
+    private static final String TAG = "InCallWakeLockContoller";
+
+    private final Context mContext;
+    private final PowerManager.WakeLock mFullWakeLock;
+    private final CallsManager mCallsManager;
+
+    InCallWakeLockController(Context context, CallsManager callsManager) {
+        mContext = context;
+        mCallsManager = callsManager;
+
+        PowerManager powerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
+        mFullWakeLock = powerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK, TAG);
+
+        callsManager.addListener(this);
+    }
+
+    @Override
+    public void onCallAdded(Call call) {
+        handleWakeLock();
+    }
+
+    @Override
+    public void onCallRemoved(Call call) {
+        handleWakeLock();
+    }
+
+    @Override
+    public void onCallStateChanged(Call call, int oldState, int newState) {
+        handleWakeLock();
+    }
+
+    private void handleWakeLock() {
+        // We grab a full lock as long as there exists a ringing call.
+        Call ringingCall = mCallsManager.getRingingCall();
+        if (ringingCall != null) {
+            mFullWakeLock.acquire();
+            Log.i(this, "Acquiring full wake lock");
+        } else if (mFullWakeLock.isHeld()) {
+            mFullWakeLock.release();
+            Log.i(this, "Releasing full wake lock");
+        }
+    }
+}
diff --git a/src/com/android/server/telecom/MissedCallNotifier.java b/src/com/android/server/telecom/MissedCallNotifier.java
index ced0fdf..ed30642 100644
--- a/src/com/android/server/telecom/MissedCallNotifier.java
+++ b/src/com/android/server/telecom/MissedCallNotifier.java
@@ -45,7 +45,6 @@
 /**
  * Creates a notification for calls that the user missed (neither answered nor rejected).
  * TODO: Make TelephonyManager.clearMissedCalls call into this class.
- * STOPSHIP: Resolve b/13769374 about moving this class to InCall.
  */
 class MissedCallNotifier extends CallsManagerListenerBase {
 
diff --git a/src/com/android/server/telecom/Timeouts.java b/src/com/android/server/telecom/Timeouts.java
index 869e98a..47c4224 100644
--- a/src/com/android/server/telecom/Timeouts.java
+++ b/src/com/android/server/telecom/Timeouts.java
@@ -60,6 +60,6 @@
      * in-call UI.
      */
     public static long getNewOutgoingCallCancelMillis(ContentResolver contentResolver) {
-        return get(contentResolver, "new_outgoing_call_cancel_ms", 200L);
+        return get(contentResolver, "new_outgoing_call_cancel_ms", 300L);
     }
 }
diff --git a/tests/Android.mk b/tests/Android.mk
index b122183..f293b80 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -20,6 +20,7 @@
 LOCAL_STATIC_JAVA_LIBRARIES := \
         android-ex-camera2 \
         guava \
+        mockito-target \
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/src/com/android/server/telecom/testapps/CallServiceNotifier.java b/tests/src/com/android/server/telecom/testapps/CallServiceNotifier.java
index 835863f..23e8222 100644
--- a/tests/src/com/android/server/telecom/testapps/CallServiceNotifier.java
+++ b/tests/src/com/android/server/telecom/testapps/CallServiceNotifier.java
@@ -111,6 +111,7 @@
                 .setSubscriptionAddress(Uri.parse("tel:555-TEST"))
                 .setCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER)
                 .setIcon(context, R.drawable.stat_sys_phone_call, Color.RED)
+                .setHighlightColor(Color.RED)
                 .setShortDescription("a short description for the call provider")
                 .setSupportedUriSchemes(Arrays.asList("tel"))
                 .build());
@@ -125,6 +126,7 @@
                 .setCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER |
                         PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)
                 .setIcon(context, R.drawable.stat_sys_phone_call, Color.GREEN)
+                .setHighlightColor(Color.GREEN)
                 .setShortDescription("a short description for the sim subscription")
                 .build());
 
diff --git a/tests/src/com/android/server/telecom/tests/unit/InCallWakeLockControllerTest.java b/tests/src/com/android/server/telecom/tests/unit/InCallWakeLockControllerTest.java
new file mode 100644
index 0000000..5af9440
--- /dev/null
+++ b/tests/src/com/android/server/telecom/tests/unit/InCallWakeLockControllerTest.java
@@ -0,0 +1,97 @@
+/*
+ * 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.
+ */
+
+package com.android.server.telecom;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.never;
+
+import android.content.Context;
+import android.os.PowerManager;
+import android.telecom.CallState;
+import android.test.AndroidTestCase;
+
+import com.android.server.telecom.Call;
+import com.android.server.telecom.CallsManager;
+import com.android.server.telecom.InCallWakeLockController;
+
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+public class InCallWakeLockControllerTest extends AndroidTestCase {
+
+    @Mock Context mContext;
+    @Mock PowerManager mPowerManager;
+    @Mock PowerManager.WakeLock mWakeLock;
+    @Mock CallsManager mCallsManager;
+    @Mock Call mCall;
+
+    private InCallWakeLockController mInCallWakeLockController;
+
+    @Override
+    public void setUp() throws Exception {
+        super.setUp();
+        MockitoAnnotations.initMocks(this);
+
+        when(mContext.getSystemService(Context.POWER_SERVICE)).thenReturn(mPowerManager);
+        when(mPowerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK, "InCallWakeLockController"))
+                .thenReturn(mWakeLock);
+        mInCallWakeLockController = new InCallWakeLockController(mContext, mCallsManager);
+    }
+
+    @Override
+    public void tearDown() {
+    }
+
+    public void test_RingingCallAdded() throws Exception {
+        when(mCallsManager.getRingingCall()).thenReturn(mCall);
+        mInCallWakeLockController.onCallAdded(mCall);
+        verify(mWakeLock).acquire();
+    }
+
+    public void test_NonRingingCallAdded() throws Exception {
+        when(mCallsManager.getRingingCall()).thenReturn(null);
+        when(mWakeLock.isHeld()).thenReturn(false);
+
+        mInCallWakeLockController.onCallAdded(mCall);
+        verify(mWakeLock, never()).acquire();
+    }
+
+    public void test_RingingCallTransition() throws Exception {
+        when(mCallsManager.getRingingCall()).thenReturn(mCall);
+        mInCallWakeLockController.onCallStateChanged(mCall, CallState.NEW, CallState.RINGING);
+        verify(mWakeLock).acquire();
+    }
+
+    public void test_RingingCallRemoved() throws Exception {
+        when(mCallsManager.getRingingCall()).thenReturn(null);
+        when(mWakeLock.isHeld()).thenReturn(false);
+
+        mInCallWakeLockController.onCallRemoved(mCall);
+        verify(mWakeLock, never()).acquire();
+    }
+
+    public void test_WakeLockReleased() throws Exception {
+        when(mCallsManager.getRingingCall()).thenReturn(null);
+        when(mWakeLock.isHeld()).thenReturn(true);
+
+        mInCallWakeLockController.onCallRemoved(mCall);
+        verify(mWakeLock).release();
+    }
+}
