diff --git a/Android.mk b/Android.mk
index 9defc7e..e9841d9 100644
--- a/Android.mk
+++ b/Android.mk
@@ -81,6 +81,8 @@
 # We specify each package explicitly to glob resource files.
 # find . -type f -name "AndroidManifest.xml" | uniq | sort | cut -c 8- | rev | cut -c 21- | rev | sed 's/\//./g' | sed 's/$/ \\/'
 LOCAL_AAPT_FLAGS := \
+	com.android.assets.product \
+	com.android.assets.quantum \
 	com.android.bubble \
 	com.android.contacts.common \
 	com.android.dialer.about \
@@ -116,8 +118,11 @@
 	com.android.dialer.main.impl \
 	com.android.dialer.notification \
 	com.android.dialer.oem \
+	com.android.dialer.phonelookup.database \
 	com.android.dialer.phonenumberutil \
 	com.android.dialer.postcall \
+	com.android.dialer.precall.impl \
+	com.android.dialer.preferredsim.impl \
 	com.android.dialer.searchfragment.common \
 	com.android.dialer.searchfragment.cp2 \
 	com.android.dialer.searchfragment.list \
@@ -129,7 +134,7 @@
 	com.android.dialer.theme \
 	com.android.dialer.util \
 	com.android.dialer.voicemail.listui \
-        com.android.dialer.voicemail.settings \
+	com.android.dialer.voicemail.settings \
 	com.android.dialer.voicemailstatus \
 	com.android.dialer.widget \
 	com.android.incallui \
diff --git a/java/com/android/contacts/common/widget/SelectPhoneAccountDialogFragment.java b/java/com/android/contacts/common/widget/SelectPhoneAccountDialogFragment.java
index 8156d97..6c6aebc 100644
--- a/java/com/android/contacts/common/widget/SelectPhoneAccountDialogFragment.java
+++ b/java/com/android/contacts/common/widget/SelectPhoneAccountDialogFragment.java
@@ -26,6 +26,7 @@
 import android.os.Handler;
 import android.os.ResultReceiver;
 import android.support.annotation.Nullable;
+import android.support.annotation.VisibleForTesting;
 import android.telecom.PhoneAccount;
 import android.telecom.PhoneAccountHandle;
 import android.telecom.TelecomManager;
@@ -116,6 +117,12 @@
     mListener = listener;
   }
 
+  @Nullable
+  @VisibleForTesting
+  public SelectPhoneAccountListener getListener() {
+    return mListener;
+  }
+
   @Override
   public void onSaveInstanceState(Bundle outState) {
     super.onSaveInstanceState(outState);
diff --git a/java/com/android/dialer/assisteddialing/ConcreteCreator.java b/java/com/android/dialer/assisteddialing/ConcreteCreator.java
index c3721a7..8067645 100644
--- a/java/com/android/dialer/assisteddialing/ConcreteCreator.java
+++ b/java/com/android/dialer/assisteddialing/ConcreteCreator.java
@@ -22,6 +22,7 @@
 import android.os.Build.VERSION_CODES;
 import android.preference.PreferenceManager;
 import android.support.annotation.NonNull;
+import android.support.annotation.VisibleForTesting;
 import android.support.v4.os.UserManagerCompat;
 import android.telephony.TelephonyManager;
 import com.android.dialer.assisteddialing.ui.R;
@@ -41,7 +42,7 @@
   // Floor set at N due to use of Optional.
   protected static final int BUILD_CODE_FLOOR = Build.VERSION_CODES.N;
   // Ceiling set at O because this feature will ship as part of the framework in P.
-  protected static final int BUILD_CODE_CEILING = Build.VERSION_CODES.O;
+  @VisibleForTesting public static final int BUILD_CODE_CEILING = Build.VERSION_CODES.O;
 
   /**
    * Creates a new AssistedDialingMediator
diff --git a/java/com/android/dialer/precall/impl/AssistedDialAction.java b/java/com/android/dialer/precall/impl/AssistedDialAction.java
new file mode 100644
index 0000000..edf97cc
--- /dev/null
+++ b/java/com/android/dialer/precall/impl/AssistedDialAction.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2017 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.dialer.precall.impl;
+
+import android.annotation.TargetApi;
+import android.os.Build;
+import android.os.Bundle;
+import android.telecom.PhoneAccount;
+import android.telephony.TelephonyManager;
+import com.android.dialer.assisteddialing.AssistedDialingMediator;
+import com.android.dialer.assisteddialing.ConcreteCreator;
+import com.android.dialer.assisteddialing.TransformationInfo;
+import com.android.dialer.callintent.CallIntentBuilder;
+import com.android.dialer.common.Assert;
+import com.android.dialer.compat.telephony.TelephonyManagerCompat;
+import com.android.dialer.precall.PreCallAction;
+import com.android.dialer.precall.PreCallCoordinator;
+import com.android.dialer.util.CallUtil;
+import java.util.Optional;
+
+/** Rewrites the call URI with country code. TODO(erfanian): use phone account for multi SIM */
+public class AssistedDialAction implements PreCallAction {
+
+  @SuppressWarnings("AndroidApiChecker") // Use of optional
+  @TargetApi(Build.VERSION_CODES.N)
+  @Override
+  public void run(PreCallCoordinator coordinator) {
+    CallIntentBuilder builder = coordinator.getBuilder();
+    if (!builder.isAssistedDialAllowed()) {
+      return;
+    }
+    AssistedDialingMediator assistedDialingMediator =
+        ConcreteCreator.createNewAssistedDialingMediator(
+            coordinator.getActivity().getSystemService(TelephonyManager.class),
+            coordinator.getActivity());
+    if (!assistedDialingMediator.isPlatformEligible()) {
+      return;
+    }
+    builder.getOutgoingCallExtras().putBoolean(TelephonyManagerCompat.ALLOW_ASSISTED_DIAL, true);
+    String phoneNumber =
+        builder.getUri().getScheme().equals(PhoneAccount.SCHEME_TEL)
+            ? builder.getUri().getSchemeSpecificPart()
+            : "";
+    Optional<TransformationInfo> transformedNumber =
+        assistedDialingMediator.attemptAssistedDial(phoneNumber);
+    if (transformedNumber.isPresent()) {
+      Bundle assistedDialingExtras = transformedNumber.get().toBundle();
+      builder.getOutgoingCallExtras().putBoolean(TelephonyManagerCompat.IS_ASSISTED_DIALED, true);
+      builder
+          .getOutgoingCallExtras()
+          .putBundle(TelephonyManagerCompat.ASSISTED_DIALING_EXTRAS, assistedDialingExtras);
+      builder.setUri(
+          CallUtil.getCallUri(Assert.isNotNull(transformedNumber.get().transformedNumber())));
+    }
+  }
+
+  @Override
+  public void onDiscard() {}
+}
diff --git a/java/com/android/dialer/precall/impl/CallingAccountSelector.java b/java/com/android/dialer/precall/impl/CallingAccountSelector.java
new file mode 100644
index 0000000..ca8798c
--- /dev/null
+++ b/java/com/android/dialer/precall/impl/CallingAccountSelector.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2017 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.dialer.precall.impl;
+
+import android.app.Activity;
+import android.support.annotation.MainThread;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.annotation.VisibleForTesting;
+import android.telecom.PhoneAccount;
+import android.telecom.PhoneAccountHandle;
+import android.telecom.TelecomManager;
+import com.android.contacts.common.widget.SelectPhoneAccountDialogFragment;
+import com.android.contacts.common.widget.SelectPhoneAccountDialogFragment.SelectPhoneAccountListener;
+import com.android.dialer.callintent.CallIntentBuilder;
+import com.android.dialer.common.Assert;
+import com.android.dialer.precall.PreCallAction;
+import com.android.dialer.precall.PreCallCoordinator;
+import java.util.List;
+
+/** PreCallAction to select which phone account to call with. Ignored if there's only one account */
+@SuppressWarnings("MissingPermission")
+public class CallingAccountSelector implements PreCallAction {
+
+  @VisibleForTesting static final String TAG_CALLING_ACCOUNT_SELECTOR = "CallingAccountSelector";
+
+  private SelectPhoneAccountDialogFragment selectPhoneAccountDialogFragment;
+
+  private boolean isDiscarding;
+
+  @Override
+  public void run(PreCallCoordinator coordinator) {
+    CallIntentBuilder builder = coordinator.getBuilder();
+    if (builder.getPhoneAccountHandle() != null) {
+      return;
+    }
+    Activity activity = coordinator.getActivity();
+    TelecomManager telecomManager = activity.getSystemService(TelecomManager.class);
+    List<PhoneAccountHandle> accounts = telecomManager.getCallCapablePhoneAccounts();
+    if (accounts.size() <= 1) {
+      return;
+    }
+    boolean isVoicemail = builder.getUri().getScheme().equals(PhoneAccount.SCHEME_VOICEMAIL);
+
+    if (!isVoicemail) {
+      PhoneAccountHandle defaultPhoneAccount =
+          telecomManager.getDefaultOutgoingPhoneAccount(builder.getUri().getScheme());
+      if (defaultPhoneAccount != null) {
+        builder.setPhoneAccountHandle(defaultPhoneAccount);
+        return;
+      }
+    }
+
+    selectPhoneAccountDialogFragment =
+        SelectPhoneAccountDialogFragment.newInstance(
+            R.string.pre_call_select_phone_account,
+            false /* canSetDefault */, // TODO(twyen): per contact defaults
+            accounts,
+            new SelectedListener(coordinator, coordinator.startPendingAction()),
+            null /* call ID */);
+    selectPhoneAccountDialogFragment.show(
+        activity.getFragmentManager(), TAG_CALLING_ACCOUNT_SELECTOR);
+  }
+
+  @Override
+  public void onDiscard() {
+    isDiscarding = true;
+    selectPhoneAccountDialogFragment.dismiss();
+  }
+
+  private class SelectedListener extends SelectPhoneAccountListener {
+
+    private final PreCallCoordinator coordinator;
+    private final PreCallCoordinator.PendingAction listener;
+
+    public SelectedListener(
+        @NonNull PreCallCoordinator builder, @NonNull PreCallCoordinator.PendingAction listener) {
+      this.coordinator = Assert.isNotNull(builder);
+      this.listener = Assert.isNotNull(listener);
+    }
+
+    @MainThread
+    @Override
+    public void onPhoneAccountSelected(
+        PhoneAccountHandle selectedAccountHandle, boolean setDefault, @Nullable String callId) {
+      coordinator.getBuilder().setPhoneAccountHandle(selectedAccountHandle);
+      listener.finish();
+    }
+
+    @MainThread
+    @Override
+    public void onDialogDismissed(@Nullable String callId) {
+      if (isDiscarding) {
+        return;
+      }
+      coordinator.abortCall();
+      listener.finish();
+    }
+  }
+}
diff --git a/java/com/android/dialer/precall/impl/PreCallImpl.java b/java/com/android/dialer/precall/impl/PreCallImpl.java
index ac9750e..fc2eff8 100644
--- a/java/com/android/dialer/precall/impl/PreCallImpl.java
+++ b/java/com/android/dialer/precall/impl/PreCallImpl.java
@@ -33,7 +33,7 @@
 
   @Override
   public ImmutableList<PreCallAction> getActions() {
-    return ImmutableList.of();
+    return ImmutableList.of(new CallingAccountSelector(), new AssistedDialAction());
   }
 
   @NonNull
diff --git a/java/com/android/dialer/precall/impl/res/values/strings.xml b/java/com/android/dialer/precall/impl/res/values/strings.xml
new file mode 100644
index 0000000..8943946
--- /dev/null
+++ b/java/com/android/dialer/precall/impl/res/values/strings.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2017 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
+  -->
+<resources>
+  <!-- Title of the dialog to select which SIM to call with before making a call, if the device has
+  multiple SIMs [CHAR LIMIT=40]-->
+  <string name="pre_call_select_phone_account">Call with</string>
+
+</resources>
\ No newline at end of file
