diff --git a/src/com/android/providers/contacts/CallLogProvider.java b/src/com/android/providers/contacts/CallLogProvider.java
index 022b61e..3999520 100644
--- a/src/com/android/providers/contacts/CallLogProvider.java
+++ b/src/com/android/providers/contacts/CallLogProvider.java
@@ -743,9 +743,8 @@
                     mDbHelper.getWritableDatabase().execSQL(
                             UNHIDE_BY_PHONE_ACCOUNT_QUERY, handleArgs);
                 } else {
-                    TelecomManager tm = TelecomManager.from(getContext());
+                    TelecomManager tm = getContext().getSystemService(TelecomManager.class);
                     if (tm != null) {
-
                         PhoneAccount account = tm.getPhoneAccount(handle);
                         if (account != null && account.getAddress() != null) {
                             // We did not find any items for the specific phone account, so run the
diff --git a/src/com/android/providers/contacts/ContactsDatabaseHelper.java b/src/com/android/providers/contacts/ContactsDatabaseHelper.java
index 91a2a91..2e5cdac 100644
--- a/src/com/android/providers/contacts/ContactsDatabaseHelper.java
+++ b/src/com/android/providers/contacts/ContactsDatabaseHelper.java
@@ -3221,8 +3221,7 @@
         //       ON_BOOT_COMPLETE instead of PRE_BOOT_COMPLETE.
         SubscriptionManager sm = SubscriptionManager.from(mContext);
         if (sm != null) {
-            Log.i(TAG, "count: " + sm.getAllSubscriptionInfoCount());
-            for (SubscriptionInfo info : sm.getAllSubscriptionInfoList()) {
+            for (SubscriptionInfo info : sm.getActiveSubscriptionInfoList()) {
                 String iccId = info.getIccId();
                 int subId = info.getSubscriptionId();
                 if (!TextUtils.isEmpty(iccId) &&
diff --git a/src/com/android/providers/contacts/ContactsProvider2.java b/src/com/android/providers/contacts/ContactsProvider2.java
index dbf6bea..89f3c70 100644
--- a/src/com/android/providers/contacts/ContactsProvider2.java
+++ b/src/com/android/providers/contacts/ContactsProvider2.java
@@ -9664,7 +9664,8 @@
     @VisibleForTesting
     protected boolean isPhone() {
         if (!mIsPhoneInitialized) {
-            mIsPhone = new TelephonyManager(getContext()).isVoiceCapable();
+            TelephonyManager tm = getContext().getSystemService(TelephonyManager.class);
+            mIsPhone = tm.isVoiceCapable();
             mIsPhoneInitialized = true;
         }
         return mIsPhone;
diff --git a/src/com/android/providers/contacts/VoicemailPermissions.java b/src/com/android/providers/contacts/VoicemailPermissions.java
index 7e409ea..fc83ebc 100644
--- a/src/com/android/providers/contacts/VoicemailPermissions.java
+++ b/src/com/android/providers/contacts/VoicemailPermissions.java
@@ -18,7 +18,7 @@
 
 import android.content.Context;
 import android.os.Binder;
-import android.telecom.DefaultDialerManager;
+import android.telecom.TelecomManager;
 import android.telephony.TelephonyManager;
 
 import com.android.providers.contacts.util.ContactsPermissions;
@@ -41,9 +41,15 @@
                 || callerHasCarrierPrivileges();
     }
 
+    private boolean isDefaultOrSystemDialer(String callingPackage) {
+        TelecomManager tm = mContext.getSystemService(TelecomManager.class);
+        return (callingPackage.equals(tm.getDefaultDialerPackage())
+                || callingPackage.equals(tm.getSystemDialerPackage()));
+    }
+
     /** Determine if the calling process has full read access to all voicemails. */
     public boolean callerHasReadAccess(String callingPackage) {
-        if (DefaultDialerManager.isDefaultOrSystemDialer(mContext, callingPackage)) {
+        if (isDefaultOrSystemDialer(callingPackage)) {
             return true;
         }
         return callerHasPermission(android.Manifest.permission.READ_VOICEMAIL);
@@ -52,7 +58,7 @@
     /** Determine if the calling process has the permission required to update and remove all
      * voicemails */
     public boolean callerHasWriteAccess(String callingPackage) {
-        if (DefaultDialerManager.isDefaultOrSystemDialer(mContext, callingPackage)) {
+        if (isDefaultOrSystemDialer(callingPackage)) {
             return true;
         }
         return callerHasPermission(android.Manifest.permission.WRITE_VOICEMAIL);
diff --git a/tests/src/com/android/providers/contacts/ContactsActor.java b/tests/src/com/android/providers/contacts/ContactsActor.java
index 470f64b..89f296b 100644
--- a/tests/src/com/android/providers/contacts/ContactsActor.java
+++ b/tests/src/com/android/providers/contacts/ContactsActor.java
@@ -16,6 +16,8 @@
 
 package com.android.providers.contacts;
 
+import static org.mockito.Mockito.when;
+
 import android.accounts.Account;
 import android.accounts.AccountManager;
 import android.accounts.AccountManagerCallback;
@@ -57,6 +59,7 @@
 import android.provider.ContactsContract.Data;
 import android.provider.ContactsContract.RawContacts;
 import android.provider.ContactsContract.StatusUpdates;
+import android.telecom.TelecomManager;
 import android.telephony.TelephonyManager;
 import android.test.IsolatedContext;
 import android.test.mock.MockContentResolver;
@@ -68,6 +71,8 @@
 
 import com.google.android.collect.Sets;
 
+import org.mockito.Mockito;
+
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -271,6 +276,8 @@
         }
     }
 
+    private TelecomManager mMockTelecomManager;
+
     /**
      * A context wrapper that reports a different user id.
      *
@@ -322,6 +329,9 @@
                 if (Context.TELEPHONY_SERVICE.equals(name)) {
                     return mMockTelephonyManager;
                 }
+                if (Context.TELECOM_SERVICE.equals(name)) {
+                    return mMockTelecomManager;
+                }
                 // Use overallContext here; super.getSystemService() somehow won't return
                 // DevicePolicyManager.
                 return overallContext.getSystemService(name);
@@ -369,6 +379,9 @@
                 if (Context.TELEPHONY_SERVICE.equals(name)) {
                     return mMockTelephonyManager;
                 }
+                if (Context.TELECOM_SERVICE.equals(name)) {
+                    return mMockTelecomManager;
+                }
                 // Use overallContext here; super.getSystemService() somehow won't return
                 // DevicePolicyManager.
                 return overallContext.getSystemService(name);
@@ -403,6 +416,9 @@
         mMockAccountManager = new MockAccountManager(mProviderContext);
         mockUserManager = new MockUserManager(mProviderContext);
         mMockTelephonyManager = new MockTelephonyManager(mProviderContext);
+        mMockTelecomManager = Mockito.mock(TelecomManager.class);
+        when(mMockTelecomManager.getDefaultDialerPackage()).thenReturn("");
+        when(mMockTelecomManager.getSystemDialerPackage()).thenReturn("");
         provider = addProvider(providerClass, authority);
     }
 
