diff --git a/java/com/android/dialer/app/calllog/CallLogAdapter.java b/java/com/android/dialer/app/calllog/CallLogAdapter.java
index 5890298..47ef32d 100644
--- a/java/com/android/dialer/app/calllog/CallLogAdapter.java
+++ b/java/com/android/dialer/app/calllog/CallLogAdapter.java
@@ -610,29 +610,31 @@
       // Restoring multi selected entries
       ArrayList<String> listOfSelectedItems =
           savedInstanceState.getStringArrayList(KEY_ACTION_MODE);
-      LogUtil.i(
-          "CallLogAdapter.onRestoreInstanceState",
-          "restored selectedItemsList:%d",
-          listOfSelectedItems.size());
-
-      if (!listOfSelectedItems.isEmpty()) {
-        for (int i = 0; i < listOfSelectedItems.size(); i++) {
-          String voicemailUri = listOfSelectedItems.get(i);
-          int id = getVoicemailId(voicemailUri);
-          LogUtil.i(
-              "CallLogAdapter.onRestoreInstanceState",
-              "restoring selected index %d, id=%d, uri=%s ",
-              i,
-              id,
-              voicemailUri);
-          selectedItems.put(id, voicemailUri);
-        }
-
+      if (listOfSelectedItems != null) {
         LogUtil.i(
-            "CallLogAdapter.onRestoreInstance",
-            "restored selectedItems %s",
-            selectedItems.toString());
-        updateActionBar();
+            "CallLogAdapter.onRestoreInstanceState",
+            "restored selectedItemsList:%d",
+            listOfSelectedItems.size());
+
+        if (!listOfSelectedItems.isEmpty()) {
+          for (int i = 0; i < listOfSelectedItems.size(); i++) {
+            String voicemailUri = listOfSelectedItems.get(i);
+            int id = getVoicemailId(voicemailUri);
+            LogUtil.i(
+                "CallLogAdapter.onRestoreInstanceState",
+                "restoring selected index %d, id=%d, uri=%s ",
+                i,
+                id,
+                voicemailUri);
+            selectedItems.put(id, voicemailUri);
+          }
+
+          LogUtil.i(
+              "CallLogAdapter.onRestoreInstance",
+              "restored selectedItems %s",
+              selectedItems.toString());
+          updateActionBar();
+        }
       }
     }
   }
diff --git a/java/com/android/dialer/app/calllog/CallLogFragment.java b/java/com/android/dialer/app/calllog/CallLogFragment.java
index 5cb0244..5e8da03 100644
--- a/java/com/android/dialer/app/calllog/CallLogFragment.java
+++ b/java/com/android/dialer/app/calllog/CallLogFragment.java
@@ -450,7 +450,9 @@
   @Override
   public void onDestroy() {
     LogUtil.enterBlock("CallLogFragment.onDestroy");
-    mAdapter.changeCursor(null);
+    if (mAdapter != null) {
+      mAdapter.changeCursor(null);
+    }
 
     getActivity().getContentResolver().unregisterContentObserver(mCallLogObserver);
     getActivity().getContentResolver().unregisterContentObserver(mContactsObserver);
@@ -467,7 +469,9 @@
     outState.putBoolean(KEY_HAS_READ_CALL_LOG_PERMISSION, mHasReadCallLogPermission);
     outState.putBoolean(KEY_REFRESH_DATA_REQUIRED, mRefreshDataRequired);
     outState.putBoolean(KEY_SELECT_ALL_MODE, selectAllMode);
-    mAdapter.onSaveInstanceState(outState);
+    if (mAdapter != null) {
+      mAdapter.onSaveInstanceState(outState);
+    }
   }
 
   @Override
diff --git a/java/com/android/dialer/app/calllog/VisualVoicemailCallLogFragment.java b/java/com/android/dialer/app/calllog/VisualVoicemailCallLogFragment.java
index 96d9173..9d8b040 100644
--- a/java/com/android/dialer/app/calllog/VisualVoicemailCallLogFragment.java
+++ b/java/com/android/dialer/app/calllog/VisualVoicemailCallLogFragment.java
@@ -128,19 +128,23 @@
 
   @Override
   public void onDestroy() {
-    getActivity()
-        .getContentResolver()
-        .unregisterContentObserver(mVoicemailErrorManager.getContentObserver());
-    mVoicemailPlaybackPresenter.onDestroy();
-    mVoicemailErrorManager.onDestroy();
-    getActivity().getContentResolver().unregisterContentObserver(mVoicemailStatusObserver);
+    if (isAdded()) {
+      getActivity()
+          .getContentResolver()
+          .unregisterContentObserver(mVoicemailErrorManager.getContentObserver());
+      mVoicemailPlaybackPresenter.onDestroy();
+      mVoicemailErrorManager.onDestroy();
+      getActivity().getContentResolver().unregisterContentObserver(mVoicemailStatusObserver);
+    }
     super.onDestroy();
   }
 
   @Override
   public void onSaveInstanceState(Bundle outState) {
     super.onSaveInstanceState(outState);
-    mVoicemailPlaybackPresenter.onSaveInstanceState(outState);
+    if (mVoicemailPlaybackPresenter != null) {
+      mVoicemailPlaybackPresenter.onSaveInstanceState(outState);
+    }
   }
 
   @Override
diff --git a/java/com/android/dialer/app/list/DialtactsPagerAdapter.java b/java/com/android/dialer/app/list/DialtactsPagerAdapter.java
index 1fbf0f0..484ab0b 100644
--- a/java/com/android/dialer/app/list/DialtactsPagerAdapter.java
+++ b/java/com/android/dialer/app/list/DialtactsPagerAdapter.java
@@ -65,7 +65,7 @@
   private ContactsFragment contactsFragment;
   private CallLogFragment voicemailFragment;
 
-  public boolean hasActiveVoicemailProvider;
+  private boolean hasActiveVoicemailProvider;
 
   public DialtactsPagerAdapter(
       Context context, FragmentManager fm, String[] tabTitles, boolean hasVoicemailProvider) {
diff --git a/java/com/android/dialer/app/list/ListsFragment.java b/java/com/android/dialer/app/list/ListsFragment.java
index 362997a..05c647a 100644
--- a/java/com/android/dialer/app/list/ListsFragment.java
+++ b/java/com/android/dialer/app/list/ListsFragment.java
@@ -203,7 +203,11 @@
             mPrefs.getBoolean(
                 VisualVoicemailEnabledChecker.PREF_KEY_HAS_ACTIVE_VOICEMAIL_PROVIDER, false));
     mViewPager.setAdapter(mAdapter);
-    mViewPager.setOffscreenPageLimit(DialtactsPagerAdapter.TAB_COUNT_WITH_VOICEMAIL - 1);
+
+    // This is deliberate. See cl/172018946 for the app startup implications of using 1 here
+    // versus loading more fragments upfront.
+    mViewPager.setOffscreenPageLimit(1);
+
     mViewPager.addOnPageChangeListener(this);
     showTab(DialtactsPagerAdapter.TAB_INDEX_SPEED_DIAL);
 
diff --git a/java/com/android/dialer/databasepopulator/VoicemailPopulator.java b/java/com/android/dialer/databasepopulator/VoicemailPopulator.java
index e99f7c7..9e0f453 100644
--- a/java/com/android/dialer/databasepopulator/VoicemailPopulator.java
+++ b/java/com/android/dialer/databasepopulator/VoicemailPopulator.java
@@ -19,9 +19,12 @@
 import android.content.ComponentName;
 import android.content.ContentValues;
 import android.content.Context;
+import android.os.Build.VERSION;
+import android.os.Build.VERSION_CODES;
 import android.provider.VoicemailContract.Status;
 import android.provider.VoicemailContract.Voicemails;
 import android.support.annotation.NonNull;
+import android.support.annotation.VisibleForTesting;
 import android.support.annotation.WorkerThread;
 import android.telecom.PhoneAccountHandle;
 import android.telephony.TelephonyManager;
@@ -98,13 +101,16 @@
         .delete(Voicemails.buildSourceUri(context.getPackageName()), "", new String[] {});
   }
 
-  private static void enableVoicemail(@NonNull Context context) {
+  @VisibleForTesting
+  public static void enableVoicemail(@NonNull Context context) {
     PhoneAccountHandle handle =
         new PhoneAccountHandle(new ComponentName(context, VoicemailPopulator.class), ACCOUNT_ID);
 
     ContentValues values = new ContentValues();
     values.put(Status.SOURCE_PACKAGE, handle.getComponentName().getPackageName());
-    values.put(Status.SOURCE_TYPE, TelephonyManager.VVM_TYPE_OMTP);
+    if (VERSION.SDK_INT >= VERSION_CODES.N_MR1) {
+      values.put(Status.SOURCE_TYPE, TelephonyManager.VVM_TYPE_OMTP);
+    }
     values.put(Status.PHONE_ACCOUNT_COMPONENT_NAME, handle.getComponentName().flattenToString());
     values.put(Status.PHONE_ACCOUNT_ID, handle.getId());
     values.put(Status.CONFIGURATION_STATE, Status.CONFIGURATION_STATE_OK);
