diff --git a/src/com/android/server/telecom/CallsManager.java b/src/com/android/server/telecom/CallsManager.java
index b5c99bc..eb42b6d 100644
--- a/src/com/android/server/telecom/CallsManager.java
+++ b/src/com/android/server/telecom/CallsManager.java
@@ -57,7 +57,6 @@
 import com.android.internal.telephony.PhoneConstants;
 import com.android.internal.telephony.TelephonyProperties;
 import com.android.internal.util.IndentingPrintWriter;
-import com.android.server.telecom.TelecomServiceImpl.DefaultDialerManagerAdapter;
 import com.android.server.telecom.callfiltering.AsyncBlockCheckFilter;
 import com.android.server.telecom.callfiltering.BlockCheckerAdapter;
 import com.android.server.telecom.callfiltering.CallFilterResultCallback;
@@ -193,7 +192,7 @@
     private final PhoneAccountRegistrar mPhoneAccountRegistrar;
     private final MissedCallNotifier mMissedCallNotifier;
     private final CallerInfoLookupHelper mCallerInfoLookupHelper;
-    private final DefaultDialerManagerAdapter mDefaultDialerManagerAdapter;
+    private final DefaultDialerCache mDefaultDialerCache;
     private final Timeouts.Adapter mTimeoutsAdapter;
     private final PhoneNumberUtilsAdapter mPhoneNumberUtilsAdapter;
     private final NotificationManager mNotificationManager;
@@ -225,7 +224,7 @@
             BluetoothManager bluetoothManager,
             WiredHeadsetManager wiredHeadsetManager,
             SystemStateProvider systemStateProvider,
-            DefaultDialerManagerAdapter defaultDialerAdapter,
+            DefaultDialerCache defaultDialerCache,
             Timeouts.Adapter timeoutsAdapter,
             AsyncRingtonePlayer asyncRingtonePlayer,
             PhoneNumberUtilsAdapter phoneNumberUtilsAdapter,
@@ -240,7 +239,7 @@
         StatusBarNotifier statusBarNotifier = new StatusBarNotifier(context, this);
         mWiredHeadsetManager = wiredHeadsetManager;
         mBluetoothManager = bluetoothManager;
-        mDefaultDialerManagerAdapter = defaultDialerAdapter;
+        mDefaultDialerCache = defaultDialerCache;
         mDockManager = new DockManager(context);
         mTimeoutsAdapter = timeoutsAdapter;
         mCallerInfoLookupHelper = new CallerInfoLookupHelper(context, mCallerInfoAsyncQueryFactory,
@@ -275,7 +274,7 @@
         RingtoneFactory ringtoneFactory = new RingtoneFactory(this, context);
         SystemVibrator systemVibrator = new SystemVibrator(context);
         mInCallController = new InCallController(
-                context, mLock, this, systemStateProvider, defaultDialerAdapter, mTimeoutsAdapter);
+                context, mLock, this, systemStateProvider, defaultDialerCache, mTimeoutsAdapter);
         mRinger = new Ringer(playerFactory, context, systemSettingsUtil, asyncRingtonePlayer,
                 ringtoneFactory, systemVibrator, mInCallController);
 
@@ -366,8 +365,7 @@
         filters.add(new DirectToVoicemailCallFilter(mCallerInfoLookupHelper));
         filters.add(new AsyncBlockCheckFilter(mContext, new BlockCheckerAdapter()));
         filters.add(new CallScreeningServiceFilter(mContext, this, mPhoneAccountRegistrar,
-                mDefaultDialerManagerAdapter,
-                new ParcelableCallUtils.Converter(), mLock));
+                mDefaultDialerCache, new ParcelableCallUtils.Converter(), mLock));
         new IncomingCallFilter(mContext, this, incomingCall, mLock,
                 mTimeoutsAdapter, filters).performFiltering();
     }
@@ -2161,6 +2159,13 @@
             pw.decreaseIndent();
         }
 
+        if (mDefaultDialerCache != null) {
+            pw.println("mDefaultDialerCache:");
+            pw.increaseIndent();
+            mDefaultDialerCache.dumpCache(pw);
+            pw.decreaseIndent();
+        }
+
         if (mConnectionServiceRepository != null) {
             pw.println("mConnectionServiceRepository:");
             pw.increaseIndent();
diff --git a/src/com/android/server/telecom/DefaultDialerCache.java b/src/com/android/server/telecom/DefaultDialerCache.java
index 9417c5e..6bef2b3 100644
--- a/src/com/android/server/telecom/DefaultDialerCache.java
+++ b/src/com/android/server/telecom/DefaultDialerCache.java
@@ -27,14 +27,40 @@
 import android.os.Looper;
 import android.os.UserHandle;
 import android.provider.Settings;
+import android.telecom.DefaultDialerManager;
 import android.telecom.Log;
 import android.util.SparseArray;
 
 import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.util.IndentingPrintWriter;
 
 import java.util.Objects;
 
 public class DefaultDialerCache {
+    public interface DefaultDialerManagerAdapter {
+        String getDefaultDialerApplication(Context context);
+        String getDefaultDialerApplication(Context context, int userId);
+        boolean setDefaultDialerApplication(Context context, String packageName, int userId);
+    }
+
+    static class DefaultDialerManagerAdapterImpl implements DefaultDialerManagerAdapter {
+        @Override
+        public String getDefaultDialerApplication(Context context) {
+            return DefaultDialerManager.getDefaultDialerApplication(context);
+        }
+
+        @Override
+        public String getDefaultDialerApplication(Context context, int userId) {
+            return DefaultDialerManager.getDefaultDialerApplication(context, userId);
+        }
+
+        @Override
+        public boolean setDefaultDialerApplication(Context context, String packageName,
+                int userId) {
+            return DefaultDialerManager.setDefaultDialerApplication(context, packageName, userId);
+        }
+    }
+
     private static final String LOG_TAG = "DefaultDialerCache";
     private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
         @Override
@@ -43,7 +69,7 @@
             try {
                 String packageName;
                 if (Intent.ACTION_PACKAGE_CHANGED.equals(intent.getAction())) {
-                    packageName = intent.getData().getSchemeSpecificPart();
+                    packageName = null;
                 } else if (Intent.ACTION_PACKAGE_REMOVED.equals(intent.getAction())
                         && !intent.getBooleanExtra(Intent.EXTRA_REPLACING, false)) {
                     packageName = intent.getData().getSchemeSpecificPart();
@@ -86,13 +112,13 @@
     };
 
     private final Context mContext;
-    private final TelecomServiceImpl.DefaultDialerManagerAdapter mDefaultDialerManagerAdapter;
+    private final DefaultDialerManagerAdapter mDefaultDialerManagerAdapter;
     private final TelecomSystem.SyncRoot mLock;
     private final String mSystemDialerName;
     private SparseArray<String> mCurrentDefaultDialerPerUser = new SparseArray<>();
 
     public DefaultDialerCache(Context context,
-            TelecomServiceImpl.DefaultDialerManagerAdapter defaultDialerManagerAdapter,
+            DefaultDialerManagerAdapter defaultDialerManagerAdapter,
             TelecomSystem.SyncRoot lock) {
         mContext = context;
         mDefaultDialerManagerAdapter = defaultDialerManagerAdapter;
@@ -136,12 +162,18 @@
         return getDefaultDialerApplication(mContext.getUserId());
     }
 
-    public boolean isDefaultOrSystemDialer(Context context, String packageName) {
-        String defaultDialer = getDefaultDialerApplication(context.getUserId());
+    public boolean isDefaultOrSystemDialer(String packageName, int userId) {
+        String defaultDialer = getDefaultDialerApplication(userId);
         return Objects.equals(packageName, defaultDialer)
                 || Objects.equals(packageName, mSystemDialerName);
     }
 
+    public boolean setDefaultDialer(String packageName, int userId) {
+        // No need to update cache -- this'll trigger the content observer.
+        return mDefaultDialerManagerAdapter.setDefaultDialerApplication(
+                mContext, packageName, userId);
+    }
+
     private String refreshCacheForUser(int userId) {
         String currentDefaultDialer =
                 mDefaultDialerManagerAdapter.getDefaultDialerApplication(mContext, userId);
@@ -168,6 +200,15 @@
         }
     }
 
+    public void dumpCache(IndentingPrintWriter pw) {
+        synchronized (mLock) {
+            for (int i = 0; i < mCurrentDefaultDialerPerUser.size(); i++) {
+                pw.printf("User %d: %s\n", mCurrentDefaultDialerPerUser.keyAt(i),
+                        mCurrentDefaultDialerPerUser.valueAt(i));
+            }
+        }
+    }
+
     /**
      * registerContentObserver is really hard to mock out, so here is a getter method for the
      * content observer for testing instead.
diff --git a/src/com/android/server/telecom/InCallController.java b/src/com/android/server/telecom/InCallController.java
index 43c0e48..2200352 100644
--- a/src/com/android/server/telecom/InCallController.java
+++ b/src/com/android/server/telecom/InCallController.java
@@ -48,7 +48,6 @@
 import com.android.internal.telecom.IInCallService;
 import com.android.internal.util.IndentingPrintWriter;
 import com.android.server.telecom.SystemStateProvider.SystemStateListener;
-import com.android.server.telecom.TelecomServiceImpl.DefaultDialerManagerAdapter;
 
 import java.util.ArrayList;
 import java.util.Collection;
@@ -614,20 +613,20 @@
     private final TelecomSystem.SyncRoot mLock;
     private final CallsManager mCallsManager;
     private final SystemStateProvider mSystemStateProvider;
-    private final DefaultDialerManagerAdapter mDefaultDialerAdapter;
     private final Timeouts.Adapter mTimeoutsAdapter;
+    private final DefaultDialerCache mDefaultDialerCache;
     private CarSwappingInCallServiceConnection mInCallServiceConnection;
     private NonUIInCallServiceConnectionCollection mNonUIInCallServiceConnections;
 
     public InCallController(Context context, TelecomSystem.SyncRoot lock, CallsManager callsManager,
             SystemStateProvider systemStateProvider,
-            DefaultDialerManagerAdapter defaultDialerAdapter, Timeouts.Adapter timeoutsAdapter) {
+            DefaultDialerCache defaultDialerCache, Timeouts.Adapter timeoutsAdapter) {
         mContext = context;
         mLock = lock;
         mCallsManager = callsManager;
         mSystemStateProvider = systemStateProvider;
-        mDefaultDialerAdapter = defaultDialerAdapter;
         mTimeoutsAdapter = timeoutsAdapter;
+        mDefaultDialerCache = defaultDialerCache;
 
         Resources resources = mContext.getResources();
         mSystemInCallComponentName = new ComponentName(
@@ -915,8 +914,8 @@
     }
 
     private InCallServiceInfo getDefaultDialerComponent() {
-        String packageName = mDefaultDialerAdapter.getDefaultDialerApplication(
-                mContext, mCallsManager.getCurrentUserHandle().getIdentifier());
+        String packageName = mDefaultDialerCache.getDefaultDialerApplication(
+                mCallsManager.getCurrentUserHandle().getIdentifier());
         Log.d(this, "Default Dialer package: " + packageName);
 
         return getInCallServiceComponent(packageName, IN_CALL_SERVICE_TYPE_DIALER_UI);
@@ -1038,8 +1037,8 @@
 
         // Check to see that it is the default dialer package
         boolean isDefaultDialerPackage = Objects.equals(serviceInfo.packageName,
-                mDefaultDialerAdapter.getDefaultDialerApplication(
-                    mContext, mCallsManager.getCurrentUserHandle().getIdentifier()));
+                mDefaultDialerCache.getDefaultDialerApplication(
+                    mCallsManager.getCurrentUserHandle().getIdentifier()));
         boolean isUIService = serviceInfo.metaData != null &&
                 serviceInfo.metaData.getBoolean(
                         TelecomManager.METADATA_IN_CALL_SERVICE_UI, false);
diff --git a/src/com/android/server/telecom/PhoneAccountRegistrar.java b/src/com/android/server/telecom/PhoneAccountRegistrar.java
index 29f6253..213ae06 100644
--- a/src/com/android/server/telecom/PhoneAccountRegistrar.java
+++ b/src/com/android/server/telecom/PhoneAccountRegistrar.java
@@ -134,6 +134,7 @@
     private final Context mContext;
     private final UserManager mUserManager;
     private final SubscriptionManager mSubscriptionManager;
+    private final DefaultDialerCache mDefaultDialerCache;
     private State mState;
     private UserHandle mCurrentUserHandle;
     private interface PhoneAccountRegistrarWriteLock {}
@@ -141,12 +142,13 @@
             new PhoneAccountRegistrarWriteLock() {};
 
     @VisibleForTesting
-    public PhoneAccountRegistrar(Context context) {
-        this(context, FILE_NAME);
+    public PhoneAccountRegistrar(Context context, DefaultDialerCache defaultDialerCache) {
+        this(context, FILE_NAME, defaultDialerCache);
     }
 
     @VisibleForTesting
-    public PhoneAccountRegistrar(Context context, String fileName) {
+    public PhoneAccountRegistrar(Context context, String fileName,
+            DefaultDialerCache defaultDialerCache) {
         // TODO: This file path is subject to change -- it is storing the phone account registry
         // state file in the path /data/system/users/0/, which is likely not correct in a
         // multi-user setting.
@@ -160,6 +162,7 @@
         mState = new State();
         mContext = context;
         mUserManager = UserManager.get(context);
+        mDefaultDialerCache = defaultDialerCache;
         mSubscriptionManager = SubscriptionManager.from(mContext);
         mCurrentUserHandle = Process.myUserHandle();
         read();
@@ -363,8 +366,8 @@
      */
     public PhoneAccountHandle getSimCallManager(UserHandle userHandle) {
         // Get the default dialer in case it has a connection manager associated with it.
-        String dialerPackage = DefaultDialerManager
-                .getDefaultDialerApplication(mContext, userHandle.getIdentifier());
+        String dialerPackage = mDefaultDialerCache
+                .getDefaultDialerApplication(userHandle.getIdentifier());
 
         // Check carrier config.
         ComponentName systemSimCallManagerComponent = getSystemSimCallManagerComponent();
diff --git a/src/com/android/server/telecom/TelecomServiceImpl.java b/src/com/android/server/telecom/TelecomServiceImpl.java
index c6ce910..9214447 100644
--- a/src/com/android/server/telecom/TelecomServiceImpl.java
+++ b/src/com/android/server/telecom/TelecomServiceImpl.java
@@ -37,7 +37,6 @@
 import android.os.Bundle;
 import android.os.Process;
 import android.os.UserHandle;
-import android.os.UserManager;
 import android.telecom.DefaultDialerManager;
 import android.telecom.Log;
 import android.telecom.ParcelableCallAnalytics;
@@ -58,6 +57,7 @@
 
 import java.io.FileDescriptor;
 import java.io.PrintWriter;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
@@ -65,34 +65,6 @@
  * Implementation of the ITelecom interface.
  */
 public class TelecomServiceImpl {
-    public interface DefaultDialerManagerAdapter {
-        String getDefaultDialerApplication(Context context);
-        String getDefaultDialerApplication(Context context, int userId);
-        boolean setDefaultDialerApplication(Context context, String packageName);
-        boolean isDefaultOrSystemDialer(Context context, String packageName);
-    }
-
-    static class DefaultDialerManagerAdapterImpl implements DefaultDialerManagerAdapter {
-        @Override
-        public String getDefaultDialerApplication(Context context) {
-            return DefaultDialerManager.getDefaultDialerApplication(context);
-        }
-
-        @Override
-        public String getDefaultDialerApplication(Context context, int userId) {
-            return DefaultDialerManager.getDefaultDialerApplication(context, userId);
-        }
-
-        @Override
-        public boolean setDefaultDialerApplication(Context context, String packageName) {
-            return DefaultDialerManager.setDefaultDialerApplication(context, packageName);
-        }
-
-        @Override
-        public boolean isDefaultOrSystemDialer(Context context, String packageName) {
-            return DefaultDialerManager.isDefaultOrSystemDialer(context, packageName);
-        }
-    }
 
     public interface SubscriptionManagerAdapter {
         int getDefaultVoiceSubId();
@@ -618,7 +590,8 @@
                 Log.startSession("TSI.gDDP");
                 final long token = Binder.clearCallingIdentity();
                 try {
-                    return mDefaultDialerManagerAdapter.getDefaultDialerApplication(mContext);
+                    return mDefaultDialerCache.getDefaultDialerApplication(
+                            ActivityManager.getCurrentUser());
                 } finally {
                     Binder.restoreCallingIdentity(token);
                 }
@@ -1123,9 +1096,8 @@
                 synchronized (mLock) {
                     long token = Binder.clearCallingIdentity();
                     try {
-                        final boolean result =
-                                mDefaultDialerManagerAdapter
-                                        .setDefaultDialerApplication(mContext, packageName);
+                        final boolean result = mDefaultDialerCache.setDefaultDialer(
+                                packageName, ActivityManager.getCurrentUser());
                         if (result) {
                             final Intent intent =
                                     new Intent(TelecomManager.ACTION_DEFAULT_DIALER_CHANGED);
@@ -1210,13 +1182,12 @@
 
     private Context mContext;
     private AppOpsManager mAppOpsManager;
-    private UserManager mUserManager;
     private PackageManager mPackageManager;
     private CallsManager mCallsManager;
     private final PhoneAccountRegistrar mPhoneAccountRegistrar;
     private final CallIntentProcessor.Adapter mCallIntentProcessorAdapter;
     private final UserCallIntentProcessorFactory mUserCallIntentProcessorFactory;
-    private final DefaultDialerManagerAdapter mDefaultDialerManagerAdapter;
+    private final DefaultDialerCache mDefaultDialerCache;
     private final SubscriptionManagerAdapter mSubscriptionManagerAdapter;
     private final TelecomSystem.SyncRoot mLock;
 
@@ -1226,20 +1197,19 @@
             PhoneAccountRegistrar phoneAccountRegistrar,
             CallIntentProcessor.Adapter callIntentProcessorAdapter,
             UserCallIntentProcessorFactory userCallIntentProcessorFactory,
-            DefaultDialerManagerAdapter defaultDialerManagerAdapter,
+            DefaultDialerCache defaultDialerCache,
             SubscriptionManagerAdapter subscriptionManagerAdapter,
             TelecomSystem.SyncRoot lock) {
         mContext = context;
         mAppOpsManager = (AppOpsManager) mContext.getSystemService(Context.APP_OPS_SERVICE);
 
-        mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
         mPackageManager = mContext.getPackageManager();
 
         mCallsManager = callsManager;
         mLock = lock;
         mPhoneAccountRegistrar = phoneAccountRegistrar;
         mUserCallIntentProcessorFactory = userCallIntentProcessorFactory;
-        mDefaultDialerManagerAdapter = defaultDialerManagerAdapter;
+        mDefaultDialerCache = defaultDialerCache;
         mCallIntentProcessorAdapter = callIntentProcessorAdapter;
         mSubscriptionManagerAdapter = subscriptionManagerAdapter;
     }
@@ -1468,7 +1438,8 @@
 
     private boolean isPrivilegedDialerCalling(String callingPackage) {
         mAppOpsManager.checkPackage(Binder.getCallingUid(), callingPackage);
-        return mDefaultDialerManagerAdapter.isDefaultOrSystemDialer(mContext, callingPackage);
+        return mDefaultDialerCache.isDefaultOrSystemDialer(
+                callingPackage, Binder.getCallingUserHandle().getIdentifier());
     }
 
     private TelephonyManager getTelephonyManager() {
diff --git a/src/com/android/server/telecom/TelecomSystem.java b/src/com/android/server/telecom/TelecomSystem.java
index 5bbce5c..8fec2dd 100644
--- a/src/com/android/server/telecom/TelecomSystem.java
+++ b/src/com/android/server/telecom/TelecomSystem.java
@@ -22,7 +22,7 @@
 import com.android.server.telecom.ui.MissedCallNotifierImpl.MissedCallNotifierImplFactory;
 import com.android.server.telecom.BluetoothPhoneServiceImpl.BluetoothPhoneServiceImplFactory;
 import com.android.server.telecom.CallAudioManager.AudioServiceFactory;
-import com.android.server.telecom.TelecomServiceImpl.DefaultDialerManagerAdapter;
+import com.android.server.telecom.DefaultDialerCache.DefaultDialerManagerAdapter;
 
 import android.Manifest;
 import android.content.BroadcastReceiver;
@@ -184,9 +184,14 @@
             InterruptionFilterProxy interruptionFilterProxy) {
         mContext = context.getApplicationContext();
         LogUtils.initLogging(mContext);
+        DefaultDialerManagerAdapter defaultDialerAdapter =
+                new DefaultDialerCache.DefaultDialerManagerAdapterImpl();
+
+        DefaultDialerCache defaultDialerCache = new DefaultDialerCache(mContext,
+                defaultDialerAdapter, mLock);
 
         Log.startSession("TS.init");
-        mPhoneAccountRegistrar = new PhoneAccountRegistrar(mContext);
+        mPhoneAccountRegistrar = new PhoneAccountRegistrar(mContext, defaultDialerCache);
         mContactsAsyncHelper = new ContactsAsyncHelper(
                 new ContactsAsyncHelper.ContentResolverAdapter() {
                     @Override
@@ -201,10 +206,7 @@
         SystemStateProvider systemStateProvider = new SystemStateProvider(mContext);
 
         mMissedCallNotifier = missedCallNotifierImplFactory
-                .makeMissedCallNotifierImpl(mContext, mPhoneAccountRegistrar);
-
-        DefaultDialerManagerAdapter defaultDialerAdapter =
-                new TelecomServiceImpl.DefaultDialerManagerAdapterImpl();
+                .makeMissedCallNotifierImpl(mContext, mPhoneAccountRegistrar, defaultDialerCache);
 
         mCallsManager = new CallsManager(
                 mContext,
@@ -220,7 +222,7 @@
                 bluetoothManager,
                 wiredHeadsetManager,
                 systemStateProvider,
-                defaultDialerAdapter,
+                defaultDialerCache,
                 timeoutsAdapter,
                 asyncRingtonePlayer,
                 phoneNumberUtilsAdapter,
@@ -253,7 +255,7 @@
                         return new UserCallIntentProcessor(context, userHandle);
                     }
                 },
-                defaultDialerAdapter,
+                defaultDialerCache,
                 new TelecomServiceImpl.SubscriptionManagerAdapterImpl(),
                 mLock);
         Log.endSession();
diff --git a/src/com/android/server/telecom/callfiltering/CallScreeningServiceFilter.java b/src/com/android/server/telecom/callfiltering/CallScreeningServiceFilter.java
index 44f5aad..4830b31 100644
--- a/src/com/android/server/telecom/callfiltering/CallScreeningServiceFilter.java
+++ b/src/com/android/server/telecom/callfiltering/CallScreeningServiceFilter.java
@@ -34,6 +34,7 @@
 import com.android.internal.telecom.ICallScreeningService;
 import com.android.server.telecom.Call;
 import com.android.server.telecom.CallsManager;
+import com.android.server.telecom.DefaultDialerCache;
 import com.android.server.telecom.LogUtils;
 import com.android.server.telecom.ParcelableCallUtils;
 import com.android.server.telecom.PhoneAccountRegistrar;
@@ -137,7 +138,7 @@
     private final Context mContext;
     private final PhoneAccountRegistrar mPhoneAccountRegistrar;
     private final CallsManager mCallsManager;
-    private final TelecomServiceImpl.DefaultDialerManagerAdapter mDefaultDialerManagerAdapter;
+    private final DefaultDialerCache mDefaultDialerCache;
     private final ParcelableCallUtils.Converter mParcelableCallUtilsConverter;
     private final TelecomSystem.SyncRoot mTelecomLock;
 
@@ -158,13 +159,13 @@
             Context context,
             CallsManager callsManager,
             PhoneAccountRegistrar phoneAccountRegistrar,
-            TelecomServiceImpl.DefaultDialerManagerAdapter defaultDialerManagerAdapter,
+            DefaultDialerCache defaultDialerCache,
             ParcelableCallUtils.Converter parcelableCallUtilsConverter,
             TelecomSystem.SyncRoot lock) {
         mContext = context;
         mPhoneAccountRegistrar = phoneAccountRegistrar;
         mCallsManager = callsManager;
-        mDefaultDialerManagerAdapter = defaultDialerManagerAdapter;
+        mDefaultDialerCache = defaultDialerCache;
         mParcelableCallUtilsConverter = parcelableCallUtilsConverter;
         mTelecomLock = lock;
     }
@@ -200,8 +201,8 @@
     }
 
     private boolean bindService() {
-        String dialerPackage = mDefaultDialerManagerAdapter
-                .getDefaultDialerApplication(mContext, UserHandle.USER_CURRENT);
+        String dialerPackage = mDefaultDialerCache
+                .getDefaultDialerApplication(UserHandle.USER_CURRENT);
         if (TextUtils.isEmpty(dialerPackage)) {
             Log.i(this, "Default dialer is empty. Not performing call screening.");
             return false;
diff --git a/src/com/android/server/telecom/components/TelecomService.java b/src/com/android/server/telecom/components/TelecomService.java
index d3cd073..ea1db36 100644
--- a/src/com/android/server/telecom/components/TelecomService.java
+++ b/src/com/android/server/telecom/components/TelecomService.java
@@ -34,6 +34,7 @@
 import com.android.server.telecom.BluetoothPhoneServiceImpl;
 import com.android.server.telecom.CallerInfoAsyncQueryFactory;
 import com.android.server.telecom.CallsManager;
+import com.android.server.telecom.DefaultDialerCache;
 import com.android.server.telecom.HeadsetMediaButton;
 import com.android.server.telecom.HeadsetMediaButtonFactory;
 import com.android.server.telecom.InCallWakeLockControllerFactory;
@@ -86,9 +87,10 @@
                                 @Override
                                 public MissedCallNotifierImpl makeMissedCallNotifierImpl(
                                         Context context,
-                                        PhoneAccountRegistrar phoneAccountRegistrar) {
+                                        PhoneAccountRegistrar phoneAccountRegistrar,
+                                        DefaultDialerCache defaultDialerCache) {
                                     return new MissedCallNotifierImpl(context,
-                                            phoneAccountRegistrar);
+                                            phoneAccountRegistrar, defaultDialerCache);
                                 }
                             },
                             new CallerInfoAsyncQueryFactory() {
diff --git a/src/com/android/server/telecom/ui/MissedCallNotifierImpl.java b/src/com/android/server/telecom/ui/MissedCallNotifierImpl.java
index 6362f66..3b8e7e0 100644
--- a/src/com/android/server/telecom/ui/MissedCallNotifierImpl.java
+++ b/src/com/android/server/telecom/ui/MissedCallNotifierImpl.java
@@ -29,6 +29,7 @@
 import com.android.server.telecom.CallerInfoLookupHelper;
 import com.android.server.telecom.CallsManagerListenerBase;
 import com.android.server.telecom.Constants;
+import com.android.server.telecom.DefaultDialerCache;
 import com.android.server.telecom.MissedCallNotifier;
 import com.android.server.telecom.PhoneAccountRegistrar;
 import com.android.server.telecom.PhoneNumberUtilsAdapter;
@@ -55,7 +56,6 @@
 import android.os.Binder;
 import android.os.UserHandle;
 import android.provider.CallLog.Calls;
-import android.telecom.DefaultDialerManager;
 import android.telecom.Log;
 import android.telecom.PhoneAccount;
 import android.telephony.PhoneNumberUtils;
@@ -86,7 +86,8 @@
 
     public interface MissedCallNotifierImplFactory {
         MissedCallNotifier makeMissedCallNotifierImpl(Context context,
-                PhoneAccountRegistrar phoneAccountRegistrar);
+                PhoneAccountRegistrar phoneAccountRegistrar,
+                DefaultDialerCache defaultDialerCache);
     }
 
     public interface NotificationBuilderFactory {
@@ -129,6 +130,7 @@
     private final NotificationManager mNotificationManager;
     private final NotificationBuilderFactory mNotificationBuilderFactory;
     private final ComponentName mNotificationComponent;
+    private final DefaultDialerCache mDefaultDialerCache;
     private UserHandle mCurrentUserHandle;
 
     // Used to track the number of missed calls.
@@ -136,18 +138,22 @@
 
     private UserHandle userToLoadAfterBootComplete;
 
-    public MissedCallNotifierImpl(Context context, PhoneAccountRegistrar phoneAccountRegistrar) {
-        this(context, phoneAccountRegistrar, new DefaultNotificationBuilderFactory());
+    public MissedCallNotifierImpl(Context context, PhoneAccountRegistrar phoneAccountRegistrar,
+            DefaultDialerCache defaultDialerCache) {
+        this(context, phoneAccountRegistrar, defaultDialerCache,
+                new DefaultNotificationBuilderFactory());
     }
 
     public MissedCallNotifierImpl(Context context,
             PhoneAccountRegistrar phoneAccountRegistrar,
+            DefaultDialerCache defaultDialerCache,
             NotificationBuilderFactory notificationBuilderFactory) {
         mContext = context;
         mPhoneAccountRegistrar = phoneAccountRegistrar;
         mNotificationManager =
                 (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
         final String notificationComponent = context.getString(R.string.notification_component);
+        mDefaultDialerCache = defaultDialerCache;
 
         mNotificationBuilderFactory = notificationBuilderFactory;
         mNotificationComponent = notificationComponent != null
@@ -240,8 +246,8 @@
      * dialer for the given user which could be a managed (work profile) dialer.
      */
     private Intent getShowMissedCallIntentForDefaultDialer(UserHandle userHandle) {
-        String dialerPackage = DefaultDialerManager
-                .getDefaultDialerApplication(mContext, userHandle.getIdentifier());
+        String dialerPackage = mDefaultDialerCache.getDefaultDialerApplication(
+                userHandle.getIdentifier());
         if (TextUtils.isEmpty(dialerPackage)) {
             return null;
         }
diff --git a/tests/src/com/android/server/telecom/tests/CallScreeningServiceFilterTest.java b/tests/src/com/android/server/telecom/tests/CallScreeningServiceFilterTest.java
index 3d3306d..3767914 100644
--- a/tests/src/com/android/server/telecom/tests/CallScreeningServiceFilterTest.java
+++ b/tests/src/com/android/server/telecom/tests/CallScreeningServiceFilterTest.java
@@ -34,6 +34,7 @@
 import com.android.internal.telecom.ICallScreeningService;
 import com.android.server.telecom.Call;
 import com.android.server.telecom.CallsManager;
+import com.android.server.telecom.DefaultDialerCache;
 import com.android.server.telecom.ParcelableCallUtils;
 import com.android.server.telecom.PhoneAccountRegistrar;
 import com.android.server.telecom.TelecomServiceImpl;
@@ -62,9 +63,8 @@
     @Mock Context mContext;
     @Mock CallsManager mCallsManager;
     @Mock PhoneAccountRegistrar mPhoneAccountRegistrar;
-    @Mock TelecomServiceImpl.DefaultDialerManagerAdapter mDefaultDialerManagerAdapter;
-    @Mock
-    ParcelableCallUtils.Converter mParcelableCallUtilsConverter;
+    @Mock DefaultDialerCache mDefaultDialerCache;
+    @Mock ParcelableCallUtils.Converter mParcelableCallUtilsConverter;
     private TelecomSystem.SyncRoot mLock = new TelecomSystem.SyncRoot() { };
 
     @Mock Call mCall;
@@ -106,10 +106,10 @@
         }};
 
         mFilter = new CallScreeningServiceFilter(mContext, mCallsManager, mPhoneAccountRegistrar,
-                mDefaultDialerManagerAdapter, mParcelableCallUtilsConverter, mLock);
+                mDefaultDialerCache, mParcelableCallUtilsConverter, mLock);
 
-        when(mDefaultDialerManagerAdapter.getDefaultDialerApplication(
-                eq(mContext), eq(UserHandle.USER_CURRENT))).thenReturn(PKG_NAME);
+        when(mDefaultDialerCache.getDefaultDialerApplication(eq(UserHandle.USER_CURRENT)))
+                .thenReturn(PKG_NAME);
         when(mPackageManager.queryIntentServicesAsUser(any(Intent.class), anyInt(), anyInt()))
                 .thenReturn(Collections.singletonList(mResolveInfo));
         when(mParcelableCallUtilsConverter.toParcelableCall(
@@ -120,8 +120,8 @@
 
     @SmallTest
     public void testNoDefaultDialer() {
-        when(mDefaultDialerManagerAdapter.getDefaultDialerApplication(
-                eq(mContext), eq(UserHandle.USER_CURRENT))).thenReturn(null);
+        when(mDefaultDialerCache.getDefaultDialerApplication(eq(UserHandle.USER_CURRENT)))
+                .thenReturn(null);
         mFilter.startFilterLookup(mCall, mCallback);
         verify(mCallback).onCallFilteringComplete(eq(mCall), eq(PASS_RESULT));
     }
diff --git a/tests/src/com/android/server/telecom/tests/DefaultDialerCacheTest.java b/tests/src/com/android/server/telecom/tests/DefaultDialerCacheTest.java
index 8ddcb1d..4c95508 100644
--- a/tests/src/com/android/server/telecom/tests/DefaultDialerCacheTest.java
+++ b/tests/src/com/android/server/telecom/tests/DefaultDialerCacheTest.java
@@ -27,7 +27,6 @@
 import android.test.suitebuilder.annotation.SmallTest;
 
 import com.android.server.telecom.DefaultDialerCache;
-import com.android.server.telecom.TelecomServiceImpl;
 import com.android.server.telecom.TelecomSystem;
 
 import org.mockito.ArgumentCaptor;
@@ -53,7 +52,7 @@
     private ContentObserver mDefaultDialerSettingObserver;
     private BroadcastReceiver mPackageChangeReceiver;
 
-    @Mock private TelecomServiceImpl.DefaultDialerManagerAdapter mMockDefaultDialerManager;
+    @Mock private DefaultDialerCache.DefaultDialerManagerAdapter mMockDefaultDialerManager;
 
     public void setUp() throws Exception {
         super.setUp();
@@ -112,9 +111,9 @@
         mPackageChangeReceiver.onReceive(mContext, packageChangeIntent);
         verify(mMockDefaultDialerManager, times(2))
                 .getDefaultDialerApplication(any(Context.class), eq(USER0));
-        verify(mMockDefaultDialerManager, times(1))
+        verify(mMockDefaultDialerManager, times(2))
                 .getDefaultDialerApplication(any(Context.class), eq(USER1));
-        verify(mMockDefaultDialerManager, times(1))
+        verify(mMockDefaultDialerManager, times(2))
                 .getDefaultDialerApplication(any(Context.class), eq(USER2));
 
         assertEquals(mDefaultDialerCache.getDefaultDialerApplication(USER0), DIALER2);
@@ -129,11 +128,11 @@
         Intent packageChangeIntent = new Intent(Intent.ACTION_PACKAGE_CHANGED,
                 Uri.fromParts("package", "red.orange.blue", null));
         mPackageChangeReceiver.onReceive(mContext, packageChangeIntent);
-        verify(mMockDefaultDialerManager, times(1))
+        verify(mMockDefaultDialerManager, times(2))
                 .getDefaultDialerApplication(any(Context.class), eq(USER0));
-        verify(mMockDefaultDialerManager, times(1))
+        verify(mMockDefaultDialerManager, times(2))
                 .getDefaultDialerApplication(any(Context.class), eq(USER1));
-        verify(mMockDefaultDialerManager, times(1))
+        verify(mMockDefaultDialerManager, times(2))
                 .getDefaultDialerApplication(any(Context.class), eq(USER2));
     }
 
diff --git a/tests/src/com/android/server/telecom/tests/InCallControllerTests.java b/tests/src/com/android/server/telecom/tests/InCallControllerTests.java
index de4d453..c44f92c 100644
--- a/tests/src/com/android/server/telecom/tests/InCallControllerTests.java
+++ b/tests/src/com/android/server/telecom/tests/InCallControllerTests.java
@@ -43,11 +43,11 @@
 import com.android.server.telecom.BluetoothHeadsetProxy;
 import com.android.server.telecom.Call;
 import com.android.server.telecom.CallsManager;
+import com.android.server.telecom.DefaultDialerCache;
 import com.android.server.telecom.InCallController;
 import com.android.server.telecom.PhoneAccountRegistrar;
 import com.android.server.telecom.R;
 import com.android.server.telecom.SystemStateProvider;
-import com.android.server.telecom.TelecomServiceImpl.DefaultDialerManagerAdapter;
 import com.android.server.telecom.TelecomSystem;
 import com.android.server.telecom.Timeouts;
 
@@ -64,7 +64,6 @@
 import static org.mockito.Matchers.anyInt;
 import static org.mockito.Matchers.anyString;
 import static org.mockito.Matchers.eq;
-import static org.mockito.Matchers.isNull;
 import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
@@ -82,8 +81,8 @@
     @Mock Call mMockCall;
     @Mock Resources mMockResources;
     @Mock MockContext mMockContext;
-    @Mock DefaultDialerManagerAdapter mMockDefaultDialerAdapter;
     @Mock Timeouts.Adapter mTimeoutsAdapter;
+    @Mock DefaultDialerCache mDefaultDialerCache;
 
     private static final int CURRENT_USER_ID = 900973;
     private static final String DEF_PKG = "defpkg";
@@ -106,7 +105,7 @@
         doReturn(SYS_PKG).when(mMockResources).getString(R.string.ui_default_package);
         doReturn(SYS_CLASS).when(mMockResources).getString(R.string.incall_default_class);
         mInCallController = new InCallController(mMockContext, mLock, mMockCallsManager,
-                mMockSystemStateProvider, mMockDefaultDialerAdapter, mTimeoutsAdapter);
+                mMockSystemStateProvider, mDefaultDialerCache, mTimeoutsAdapter);
     }
 
     @Override
@@ -185,7 +184,7 @@
         when(mMockCall.getTargetPhoneAccount()).thenReturn(PA_HANDLE);
         when(mMockCall.getIntentExtras()).thenReturn(callExtras);
         when(mMockCall.isExternalCall()).thenReturn(false);
-        when(mMockDefaultDialerAdapter.getDefaultDialerApplication(mMockContext, CURRENT_USER_ID))
+        when(mDefaultDialerCache.getDefaultDialerApplication(CURRENT_USER_ID))
                 .thenReturn(DEF_PKG);
         when(mMockContext.bindServiceAsUser(any(Intent.class), any(ServiceConnection.class),
                 anyInt(), eq(UserHandle.CURRENT))).thenReturn(true);
@@ -235,7 +234,7 @@
         when(mMockCall.getTargetPhoneAccount()).thenReturn(PA_HANDLE);
         when(mMockCall.getIntentExtras()).thenReturn(callExtras);
         when(mMockCall.isExternalCall()).thenReturn(false);
-        when(mMockDefaultDialerAdapter.getDefaultDialerApplication(mMockContext, CURRENT_USER_ID))
+        when(mDefaultDialerCache.getDefaultDialerApplication(CURRENT_USER_ID))
                 .thenReturn(DEF_PKG);
         when(mMockContext.bindServiceAsUser(any(Intent.class), any(ServiceConnection.class),
                 eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE),
@@ -291,7 +290,7 @@
         when(mMockCall.getIntentExtras()).thenReturn(callExtras);
         when(mMockCall.isExternalCall()).thenReturn(false);
         when(mMockCall.getConferenceableCalls()).thenReturn(Collections.emptyList());
-        when(mMockDefaultDialerAdapter.getDefaultDialerApplication(mMockContext, CURRENT_USER_ID))
+        when(mDefaultDialerCache.getDefaultDialerApplication(CURRENT_USER_ID))
                 .thenReturn(DEF_PKG);
         when(mMockContext.bindServiceAsUser(
                 any(Intent.class), any(ServiceConnection.class), anyInt(), any(UserHandle.class)))
@@ -406,8 +405,7 @@
         when(mMockCallsManager.hasEmergencyCall()).thenReturn(false);
         when(mMockCall.isIncoming()).thenReturn(true);
         when(mMockCall.isExternalCall()).thenReturn(false);
-        when(mMockDefaultDialerAdapter.getDefaultDialerApplication(mMockContext, CURRENT_USER_ID))
-                .thenReturn(DEF_PKG);
+        when(mDefaultDialerCache.getDefaultDialerApplication(CURRENT_USER_ID)).thenReturn(DEF_PKG);
         when(mMockContext.bindServiceAsUser(
                 any(Intent.class), any(ServiceConnection.class), anyInt(), any(UserHandle.class)))
                 .thenReturn(true);
@@ -456,8 +454,7 @@
         when(mMockCallsManager.hasEmergencyCall()).thenReturn(false);
         when(mMockCall.isIncoming()).thenReturn(false);
         when(mMockCall.getTargetPhoneAccount()).thenReturn(PA_HANDLE);
-        when(mMockDefaultDialerAdapter.getDefaultDialerApplication(mMockContext, CURRENT_USER_ID))
-                .thenReturn(DEF_PKG);
+        when(mDefaultDialerCache.getDefaultDialerApplication(CURRENT_USER_ID)).thenReturn(DEF_PKG);
         when(mMockContext.bindServiceAsUser(any(Intent.class), any(ServiceConnection.class),
                 anyInt(), eq(UserHandle.CURRENT))).thenReturn(true);
         when(mMockCall.isExternalCall()).thenReturn(isExternalCall);
diff --git a/tests/src/com/android/server/telecom/tests/MissedCallNotifierImplTest.java b/tests/src/com/android/server/telecom/tests/MissedCallNotifierImplTest.java
index 2663356..13a85af 100644
--- a/tests/src/com/android/server/telecom/tests/MissedCallNotifierImplTest.java
+++ b/tests/src/com/android/server/telecom/tests/MissedCallNotifierImplTest.java
@@ -41,6 +41,7 @@
 import com.android.internal.telephony.CallerInfo;
 import com.android.server.telecom.CallerInfoLookupHelper;
 import com.android.server.telecom.Constants;
+import com.android.server.telecom.DefaultDialerCache;
 import com.android.server.telecom.MissedCallNotifier;
 import com.android.server.telecom.PhoneAccountRegistrar;
 import com.android.server.telecom.PhoneNumberUtilsAdapterImpl;
@@ -144,6 +145,7 @@
     private TelecomManager mTelecomManager;
 
     @Mock TelecomSystem mTelecomSystem;
+    @Mock private DefaultDialerCache mDefaultDialerCache;
 
     @Override
     public void setUp() throws Exception {
@@ -229,7 +231,7 @@
                 makeNotificationBuilderFactory(builders);
 
         MissedCallNotifier missedCallNotifier = new MissedCallNotifierImpl(mContext,
-                mPhoneAccountRegistrar, fakeBuilderFactory);
+                mPhoneAccountRegistrar, mDefaultDialerCache, fakeBuilderFactory);
 
         missedCallNotifier.showMissedCallNotification(fakeCall);
         missedCallNotifier.showMissedCallNotification(fakeCall);
@@ -378,7 +380,7 @@
                 makeNotificationBuilderFactory(builder1);
 
         MissedCallNotifier missedCallNotifier = new MissedCallNotifierImpl(mContext,
-                mPhoneAccountRegistrar, fakeBuilderFactory);
+                mPhoneAccountRegistrar, mDefaultDialerCache, fakeBuilderFactory);
         PhoneAccount phoneAccount = makePhoneAccount(PRIMARY_USER, NO_CAPABILITY);
 
         MissedCallNotifier.CallInfo fakeCall =
@@ -437,7 +439,7 @@
                 makeNotificationBuilderFactory(builder1);
 
         MissedCallNotifier missedCallNotifier = new MissedCallNotifierImpl(mContext,
-                mPhoneAccountRegistrar, fakeBuilderFactory);
+                mPhoneAccountRegistrar, mDefaultDialerCache, fakeBuilderFactory);
 
         // AsyncQueryHandler used in reloadFromDatabase interacts poorly with the below
         // timeout-verify, so run this in a new handler to mitigate that.
@@ -505,7 +507,7 @@
                 makeNotificationBuilderFactory(builder1);
 
         MissedCallNotifier missedCallNotifier = new MissedCallNotifierImpl(mContext,
-                mPhoneAccountRegistrar, fakeBuilderFactory);
+                mPhoneAccountRegistrar, mDefaultDialerCache, fakeBuilderFactory);
 
         // AsyncQueryHandler used in reloadFromDatabase interacts poorly with the below
         // timeout-verify, so run this in a new handler to mitigate that.
@@ -567,7 +569,7 @@
     private MissedCallNotifier makeMissedCallNotifier(
             NotificationBuilderFactory fakeBuilderFactory, UserHandle currentUser) {
         MissedCallNotifier missedCallNotifier = new MissedCallNotifierImpl(mContext,
-                mPhoneAccountRegistrar, fakeBuilderFactory);
+                mPhoneAccountRegistrar, mDefaultDialerCache, fakeBuilderFactory);
         missedCallNotifier.setCurrentUserHandle(currentUser);
         return missedCallNotifier;
     }
diff --git a/tests/src/com/android/server/telecom/tests/PhoneAccountRegistrarTest.java b/tests/src/com/android/server/telecom/tests/PhoneAccountRegistrarTest.java
index 7b5b836..c7e9068 100644
--- a/tests/src/com/android/server/telecom/tests/PhoneAccountRegistrarTest.java
+++ b/tests/src/com/android/server/telecom/tests/PhoneAccountRegistrarTest.java
@@ -35,6 +35,7 @@
 
 import com.android.internal.telecom.IConnectionService;
 import com.android.internal.util.FastXmlSerializer;
+import com.android.server.telecom.DefaultDialerCache;
 import com.android.server.telecom.PhoneAccountRegistrar;
 import com.android.server.telecom.PhoneAccountRegistrar.DefaultPhoneAccountHandle;
 
@@ -52,13 +53,16 @@
 import java.util.Arrays;
 import java.util.Set;
 
+import static org.mockito.Matchers.anyInt;
+import static org.mockito.Mockito.when;
+
 public class PhoneAccountRegistrarTest extends TelecomTestCase {
 
     private static final int MAX_VERSION = Integer.MAX_VALUE;
     private static final String FILE_NAME = "phone-account-registrar-test-1223.xml";
     private PhoneAccountRegistrar mRegistrar;
-    @Mock
-    private TelecomManager mTelecomManager;
+    @Mock private TelecomManager mTelecomManager;
+    @Mock private DefaultDialerCache mDefaultDialerCache;
 
     @Override
     public void setUp() throws Exception {
@@ -69,9 +73,11 @@
                 mComponentContextFixture.getTestDouble().getApplicationContext().getFilesDir(),
                 FILE_NAME)
                 .delete();
+        when(mDefaultDialerCache.getDefaultDialerApplication(anyInt()))
+                .thenReturn("com.android.dialer");
         mRegistrar = new PhoneAccountRegistrar(
                 mComponentContextFixture.getTestDouble().getApplicationContext(),
-                FILE_NAME);
+                FILE_NAME, mDefaultDialerCache);
     }
 
     @Override
diff --git a/tests/src/com/android/server/telecom/tests/TelecomServiceImplTest.java b/tests/src/com/android/server/telecom/tests/TelecomServiceImplTest.java
index 8de54bf..6baaf85 100644
--- a/tests/src/com/android/server/telecom/tests/TelecomServiceImplTest.java
+++ b/tests/src/com/android/server/telecom/tests/TelecomServiceImplTest.java
@@ -21,6 +21,7 @@
 import static android.Manifest.permission.READ_PHONE_STATE;
 import static android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE;
 
+import android.app.ActivityManager;
 import android.app.AppOpsManager;
 import android.content.ComponentName;
 import android.content.Context;
@@ -45,6 +46,7 @@
 import com.android.server.telecom.CallIntentProcessor;
 import com.android.server.telecom.CallState;
 import com.android.server.telecom.CallsManager;
+import com.android.server.telecom.DefaultDialerCache;
 import com.android.server.telecom.PhoneAccountRegistrar;
 import com.android.server.telecom.TelecomServiceImpl;
 import com.android.server.telecom.TelecomSystem;
@@ -53,7 +55,6 @@
 
 import org.mockito.ArgumentCaptor;
 import org.mockito.ArgumentMatcher;
-import org.mockito.Matchers;
 import org.mockito.Mock;
 import org.mockito.internal.matchers.VarargMatcher;
 
@@ -98,29 +99,6 @@
         }
     }
 
-    public static class DefaultDialerManagerAdapterFake
-            implements TelecomServiceImpl.DefaultDialerManagerAdapter {
-        @Override
-        public String getDefaultDialerApplication(Context context) {
-            return null;
-        }
-
-        @Override
-        public String getDefaultDialerApplication(Context context, int userId) {
-            return null;
-        }
-
-        @Override
-        public boolean setDefaultDialerApplication(Context context, String packageName) {
-            return false;
-        }
-
-        @Override
-        public boolean isDefaultOrSystemDialer(Context context, String packageName) {
-            return false;
-        }
-    }
-
     public static class SubscriptionManagerAdapterFake
             implements TelecomServiceImpl.SubscriptionManagerAdapter {
         @Override
@@ -157,8 +135,7 @@
     @Mock private TelecomManager mTelecomManager;
     private CallIntentProcessor.Adapter mCallIntentProcessorAdapter =
             spy(new CallIntentProcessAdapterFake());
-    private TelecomServiceImpl.DefaultDialerManagerAdapter mDefaultDialerManagerAdapter =
-            spy(new DefaultDialerManagerAdapterFake());
+    @Mock private DefaultDialerCache mDefaultDialerCache;
     private TelecomServiceImpl.SubscriptionManagerAdapter mSubscriptionManagerAdapter =
             spy(new SubscriptionManagerAdapterFake());
     @Mock private UserCallIntentProcessor mUserCallIntentProcessor;
@@ -198,7 +175,7 @@
                         return mUserCallIntentProcessor;
                     }
                 },
-                mDefaultDialerManagerAdapter,
+                mDefaultDialerCache,
                 mSubscriptionManagerAdapter,
                 mLock);
         mTSIBinder = telecomServiceImpl.getBinder();
@@ -209,13 +186,10 @@
         mAppOpsManager = (AppOpsManager) mContext.getSystemService(Context.APP_OPS_SERVICE);
         mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
 
-        doReturn(DEFAULT_DIALER_PACKAGE)
-                .when(mDefaultDialerManagerAdapter)
-                .getDefaultDialerApplication(any(Context.class));
-
-        doReturn(true)
-                .when(mDefaultDialerManagerAdapter)
-                .isDefaultOrSystemDialer(any(Context.class), eq(DEFAULT_DIALER_PACKAGE));
+        when(mDefaultDialerCache.getDefaultDialerApplication(anyInt()))
+                .thenReturn(DEFAULT_DIALER_PACKAGE);
+        when(mDefaultDialerCache.isDefaultOrSystemDialer(eq(DEFAULT_DIALER_PACKAGE), anyInt()))
+                .thenReturn(true);
     }
 
     @SmallTest
@@ -728,15 +702,14 @@
     @SmallTest
     public void testSetDefaultDialer() throws Exception {
         String packageName = "sample.package";
+        int currentUser = ActivityManager.getCurrentUser();
 
-        doReturn(true)
-                .when(mDefaultDialerManagerAdapter)
-                .setDefaultDialerApplication(any(Context.class), eq(packageName));
+        when(mDefaultDialerCache.setDefaultDialer(eq(packageName), eq(currentUser)))
+                .thenReturn(true);
 
         mTSIBinder.setDefaultDialer(packageName);
 
-        verify(mDefaultDialerManagerAdapter).setDefaultDialerApplication(any(Context.class),
-                eq(packageName));
+        verify(mDefaultDialerCache).setDefaultDialer(eq(packageName), eq(currentUser));
         ArgumentCaptor<Intent> intentCaptor = ArgumentCaptor.forClass(Intent.class);
         verify(mContext).sendBroadcastAsUser(intentCaptor.capture(), any(UserHandle.class));
         Intent capturedIntent = intentCaptor.getValue();
@@ -768,8 +741,7 @@
             exceptionThrown = true;
         }
         assertTrue(exceptionThrown);
-        verify(mDefaultDialerManagerAdapter, never()).setDefaultDialerApplication(
-                any(Context.class), anyString());
+        verify(mDefaultDialerCache, never()).setDefaultDialer(anyString(), anyInt());
         verify(mContext, never()).sendBroadcastAsUser(any(Intent.class), any(UserHandle.class));
     }
 
diff --git a/tests/src/com/android/server/telecom/tests/TelecomSystemTest.java b/tests/src/com/android/server/telecom/tests/TelecomSystemTest.java
index c5e7f60..ece6b73 100644
--- a/tests/src/com/android/server/telecom/tests/TelecomSystemTest.java
+++ b/tests/src/com/android/server/telecom/tests/TelecomSystemTest.java
@@ -67,6 +67,7 @@
 import com.android.server.telecom.CallerInfoLookupHelper;
 import com.android.server.telecom.CallsManager;
 import com.android.server.telecom.CallsManagerListenerBase;
+import com.android.server.telecom.DefaultDialerCache;
 import com.android.server.telecom.HeadsetMediaButton;
 import com.android.server.telecom.HeadsetMediaButtonFactory;
 import com.android.server.telecom.InCallWakeLockController;
@@ -373,7 +374,8 @@
                 new MissedCallNotifierImplFactory() {
                     @Override
                     public MissedCallNotifier makeMissedCallNotifierImpl(Context context,
-                            PhoneAccountRegistrar phoneAccountRegistrar) {
+                            PhoneAccountRegistrar phoneAccountRegistrar,
+                            DefaultDialerCache defaultDialerCache) {
                         return mMissedCallNotifier;
                     }
                 },
