diff --git a/assets/quantum/res/drawable/quantum_ic_group_vd_theme_24.xml b/assets/quantum/res/drawable/quantum_ic_group_vd_theme_24.xml
new file mode 100644
index 0000000..1845bbf
--- /dev/null
+++ b/assets/quantum/res/drawable/quantum_ic_group_vd_theme_24.xml
@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="24dp"
+        android:height="24dp"
+        android:viewportWidth="24.0"
+        android:viewportHeight="24.0"
+        android:tint="?attr/colorControlNormal">
+    <path
+        android:fillColor="@android:color/white"
+        android:pathData="M16,11c1.66,0 2.99,-1.34 2.99,-3S17.66,5 16,5c-1.66,0 -3,1.34 -3,3s1.34,3 3,3zM8,11c1.66,0 2.99,-1.34 2.99,-3S9.66,5 8,5C6.34,5 5,6.34 5,8s1.34,3 3,3zM8,13c-2.33,0 -7,1.17 -7,3.5L1,19h14v-2.5c0,-2.33 -4.67,-3.5 -7,-3.5zM16,13c-0.29,0 -0.62,0.02 -0.97,0.05 1.16,0.84 1.97,1.97 1.97,3.45L17,19h6v-2.5c0,-2.33 -4.67,-3.5 -7,-3.5z"/>
+</vector>
diff --git a/java/com/android/contacts/common/lettertiles/LetterTileDrawable.java b/java/com/android/contacts/common/lettertiles/LetterTileDrawable.java
index f8ea140..88522c4 100644
--- a/java/com/android/contacts/common/lettertiles/LetterTileDrawable.java
+++ b/java/com/android/contacts/common/lettertiles/LetterTileDrawable.java
@@ -61,6 +61,7 @@
    */
   public static final int TYPE_GENERIC_AVATAR = 4;
   public static final int TYPE_SPAM = 5;
+  public static final int TYPE_CONFERENCE = 6;
   @ContactType public static final int TYPE_DEFAULT = TYPE_PERSON;
 
   /**
@@ -99,6 +100,8 @@
   private static Drawable sDefaultBusinessAvatar;
   private static Drawable sDefaultVoicemailAvatar;
   private static Drawable sDefaultSpamAvatar;
+  private static Drawable sDefaultConferenceAvatar;
+
   private final Paint mPaint;
   @ContactType private int mContactType = TYPE_DEFAULT;
   private float mScale = 1.0f;
@@ -122,6 +125,7 @@
       sDefaultBusinessAvatar = res.getDrawable(R.drawable.quantum_ic_business_vd_theme_24, null);
       sDefaultVoicemailAvatar = res.getDrawable(R.drawable.quantum_ic_voicemail_vd_theme_24, null);
       sDefaultSpamAvatar = res.getDrawable(R.drawable.quantum_ic_report_vd_theme_24, null);
+      sDefaultConferenceAvatar = res.getDrawable(R.drawable.quantum_ic_group_vd_theme_24, null);
       sPaint.setTypeface(
           Typeface.create(res.getString(R.string.letter_tile_letter_font_family), Typeface.NORMAL));
       sPaint.setTextAlign(Align.CENTER);
@@ -159,6 +163,9 @@
       case TYPE_SPAM:
         mScale = VECTOR_ICON_SCALE;
         return sDefaultSpamAvatar;
+      case TYPE_CONFERENCE:
+        mScale = VECTOR_ICON_SCALE;
+        return sDefaultConferenceAvatar;
       case TYPE_PERSON:
       case TYPE_GENERIC_AVATAR:
       default:
diff --git a/java/com/android/dialer/app/calllog/CallLogAsyncTaskUtil.java b/java/com/android/dialer/app/calllog/CallLogAsyncTaskUtil.java
index a583574..a5553d1 100644
--- a/java/com/android/dialer/app/calllog/CallLogAsyncTaskUtil.java
+++ b/java/com/android/dialer/app/calllog/CallLogAsyncTaskUtil.java
@@ -56,11 +56,15 @@
           public Void doInBackground(Void... params) {
             ContentValues values = new ContentValues();
             values.put(Voicemails.IS_READ, true);
-            context
-                .getContentResolver()
-                .update(voicemailUri, values, Voicemails.IS_READ + " = 0", null);
-
-            uploadVoicemailLocalChangesToServer(context);
+            // "External" changes to the database will be automatically marked as dirty, but this
+            // voicemail might be from dialer so it need to be marked manually.
+            values.put(Voicemails.DIRTY, 1);
+            if (context
+                    .getContentResolver()
+                    .update(voicemailUri, values, Voicemails.IS_READ + " = 0", null)
+                > 0) {
+              uploadVoicemailLocalChangesToServer(context);
+            }
 
             Intent intent = new Intent(context, CallLogNotificationsService.class);
             intent.setAction(CallLogNotificationsService.ACTION_MARK_NEW_VOICEMAILS_AS_OLD);
diff --git a/java/com/android/dialer/blocking/FilteredNumberCompat.java b/java/com/android/dialer/blocking/FilteredNumberCompat.java
index 0ee85d8..9e01127 100644
--- a/java/com/android/dialer/blocking/FilteredNumberCompat.java
+++ b/java/com/android/dialer/blocking/FilteredNumberCompat.java
@@ -275,7 +275,8 @@
         && safeBlockedNumbersContractCanCurrentUserBlockNumbers(context);
   }
 
-  static void setCanAttemptBlockOperationsForTest(boolean canAttempt) {
+  @VisibleForTesting(otherwise = VisibleForTesting.NONE)
+  public static void setCanAttemptBlockOperationsForTest(boolean canAttempt) {
     canAttemptBlockOperationsForTest = canAttempt;
   }
 
diff --git a/java/com/android/dialer/blocking/FilteredNumbersUtil.java b/java/com/android/dialer/blocking/FilteredNumbersUtil.java
index 3c001a2..cdcf1f7 100644
--- a/java/com/android/dialer/blocking/FilteredNumbersUtil.java
+++ b/java/com/android/dialer/blocking/FilteredNumbersUtil.java
@@ -22,12 +22,12 @@
 import android.content.Context;
 import android.database.Cursor;
 import android.os.AsyncTask;
-import android.preference.PreferenceManager;
 import android.provider.ContactsContract.CommonDataKinds.Phone;
 import android.provider.ContactsContract.Contacts;
 import android.provider.Settings;
 import android.support.annotation.Nullable;
 import android.support.annotation.VisibleForTesting;
+import android.support.v4.os.UserManagerCompat;
 import android.telephony.PhoneNumberUtils;
 import android.text.TextUtils;
 import android.widget.Toast;
@@ -39,6 +39,7 @@
 import com.android.dialer.notification.NotificationChannelManager.Channel;
 import com.android.dialer.util.DialerUtils;
 import com.android.dialer.util.PermissionsUtil;
+import java.util.concurrent.TimeUnit;
 
 /** Utility to help with tasks related to filtered numbers. */
 public class FilteredNumbersUtil {
@@ -54,7 +55,7 @@
   protected static final String NOTIFIED_CALL_BLOCKING_DISABLED_BY_EMERGENCY_CALL_PREF_KEY =
       "notified_call_blocking_disabled_by_emergency_call";
   // Disable incoming call blocking if there was a call within the past 2 days.
-  private static final long RECENT_EMERGENCY_CALL_THRESHOLD_MS = 1000 * 60 * 60 * 24 * 2;
+  static final long RECENT_EMERGENCY_CALL_THRESHOLD_MS = TimeUnit.DAYS.toMillis(2);
 
   /**
    * Used for testing to specify the custom threshold value, in milliseconds for whether an
@@ -210,13 +211,15 @@
       return;
     }
 
-    PreferenceManager.getDefaultSharedPreferences(context)
+    DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context)
         .edit()
         .putLong(LAST_EMERGENCY_CALL_MS_PREF_KEY, System.currentTimeMillis())
         .putBoolean(NOTIFIED_CALL_BLOCKING_DISABLED_BY_EMERGENCY_CALL_PREF_KEY, false)
         .apply();
 
-    maybeNotifyCallBlockingDisabled(context);
+    if (UserManagerCompat.isUserUnlocked(context)) {
+      maybeNotifyCallBlockingDisabled(context);
+    }
   }
 
   public static void maybeNotifyCallBlockingDisabled(final Context context) {
@@ -225,7 +228,7 @@
       return;
     }
     // Skip if the user has already received a notification for the most recent emergency call.
-    if (PreferenceManager.getDefaultSharedPreferences(context)
+    if (DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context)
         .getBoolean(NOTIFIED_CALL_BLOCKING_DISABLED_BY_EMERGENCY_CALL_PREF_KEY, false)) {
       return;
     }
@@ -265,7 +268,7 @@
                 builder.build());
 
             // Record that the user has been notified for this emergency call.
-            PreferenceManager.getDefaultSharedPreferences(context)
+            DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context)
                 .edit()
                 .putBoolean(NOTIFIED_CALL_BLOCKING_DISABLED_BY_EMERGENCY_CALL_PREF_KEY, true)
                 .apply();
diff --git a/java/com/android/dialer/notification/NotificationChannelManager.java b/java/com/android/dialer/notification/NotificationChannelManager.java
index 599e5ca..8867906 100644
--- a/java/com/android/dialer/notification/NotificationChannelManager.java
+++ b/java/com/android/dialer/notification/NotificationChannelManager.java
@@ -312,7 +312,9 @@
         importance = NotificationManager.IMPORTANCE_DEFAULT;
         canShowBadge = true;
         lights = true;
-        vibration = true;
+        vibration =
+            TelephonyManagerCompat.isVoicemailVibrationEnabled(
+                getTelephonyManager(context), phoneAccountHandle);
         sound =
             TelephonyManagerCompat.getVoicemailRingtoneUri(
                 getTelephonyManager(context), phoneAccountHandle);
diff --git a/java/com/android/dialer/postcall/PostCall.java b/java/com/android/dialer/postcall/PostCall.java
index edc07ba..586b473 100644
--- a/java/com/android/dialer/postcall/PostCall.java
+++ b/java/com/android/dialer/postcall/PostCall.java
@@ -20,7 +20,6 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.SharedPreferences;
-import android.preference.PreferenceManager;
 import android.support.annotation.Nullable;
 import android.support.design.widget.BaseTransientBottomBar.BaseCallback;
 import android.support.design.widget.Snackbar;
@@ -101,7 +100,7 @@
                 activity.getResources().getColor(R.color.dialer_snackbar_action_text_color));
     activeSnackbar.show();
     Logger.get(activity).logImpression(DialerImpression.Type.POST_CALL_PROMPT_USER_TO_SEND_MESSAGE);
-    PreferenceManager.getDefaultSharedPreferences(activity)
+    DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(activity)
         .edit()
         .remove(KEY_POST_CALL_CALL_DISCONNECT_TIME)
         .apply();
@@ -138,14 +137,14 @@
     activeSnackbar.show();
     Logger.get(activity)
         .logImpression(DialerImpression.Type.POST_CALL_PROMPT_USER_TO_VIEW_SENT_MESSAGE);
-    PreferenceManager.getDefaultSharedPreferences(activity)
+    DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(activity)
         .edit()
         .remove(KEY_POST_CALL_MESSAGE_SENT)
         .apply();
   }
 
   public static void onCallDisconnected(Context context, String number, long callConnectedMillis) {
-    PreferenceManager.getDefaultSharedPreferences(context)
+    DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context)
         .edit()
         .putLong(KEY_POST_CALL_CALL_CONNECT_TIME, callConnectedMillis)
         .putLong(KEY_POST_CALL_CALL_DISCONNECT_TIME, System.currentTimeMillis())
@@ -154,7 +153,7 @@
   }
 
   public static void onMessageSent(Context context, String number) {
-    PreferenceManager.getDefaultSharedPreferences(context)
+    DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context)
         .edit()
         .putString(KEY_POST_CALL_CALL_NUMBER, number)
         .putBoolean(KEY_POST_CALL_MESSAGE_SENT, true)
@@ -164,7 +163,7 @@
   private static void clear(Context context) {
     activeSnackbar = null;
 
-    PreferenceManager.getDefaultSharedPreferences(context)
+    DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context)
         .edit()
         .remove(KEY_POST_CALL_CALL_DISCONNECT_TIME)
         .remove(KEY_POST_CALL_CALL_NUMBER)
@@ -174,7 +173,8 @@
   }
 
   private static boolean shouldPromptUserToSendMessage(Context context) {
-    SharedPreferences manager = PreferenceManager.getDefaultSharedPreferences(context);
+    SharedPreferences manager =
+        DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context);
     long disconnectTimeMillis = manager.getLong(KEY_POST_CALL_CALL_DISCONNECT_TIME, -1);
     long connectTimeMillis = manager.getLong(KEY_POST_CALL_CALL_CONNECT_TIME, -1);
 
@@ -192,13 +192,13 @@
   }
 
   private static boolean shouldPromptUserToViewSentMessage(Context context) {
-    return PreferenceManager.getDefaultSharedPreferences(context)
+    return DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context)
         .getBoolean(KEY_POST_CALL_MESSAGE_SENT, false);
   }
 
   @Nullable
   private static String getPhoneNumber(Context context) {
-    return PreferenceManager.getDefaultSharedPreferences(context)
+    return DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context)
         .getString(KEY_POST_CALL_CALL_NUMBER, null);
   }
 
diff --git a/java/com/android/incallui/CallCardPresenter.java b/java/com/android/incallui/CallCardPresenter.java
index 0b3592d..c2b99c1 100644
--- a/java/com/android/incallui/CallCardPresenter.java
+++ b/java/com/android/incallui/CallCardPresenter.java
@@ -465,7 +465,8 @@
                   shouldShowCallSubject(mPrimary) ? mPrimary.getCallSubject() : null,
                   mPrimary.getCallbackNumber(),
                   mPrimary.hasProperty(Details.PROPERTY_WIFI),
-                  mPrimary.isConferenceCall(),
+                  mPrimary.isConferenceCall()
+                      && !mPrimary.hasProperty(Details.PROPERTY_GENERIC_CONFERENCE),
                   isWorkCall,
                   isAttemptingHdAudioCall,
                   isHdAudioCall,
@@ -699,7 +700,7 @@
               false /* nameIsNumber */,
               null /* location */,
               null /* label */,
-              getConferencePhoto(mPrimary),
+              null /* photo */,
               ContactPhotoType.DEFAULT_PLACEHOLDER,
               false /* isSipCall */,
               showContactPhoto,
@@ -1043,16 +1044,6 @@
     return mContext.getResources().getString(resId);
   }
 
-  private Drawable getConferencePhoto(DialerCall call) {
-    boolean isGenericConference = call.hasProperty(Details.PROPERTY_GENERIC_CONFERENCE);
-    LogUtil.v("CallCardPresenter.getConferencePhoto", "" + isGenericConference);
-
-    final int resId = isGenericConference ? R.drawable.img_phone : R.drawable.img_conference;
-    Drawable photo = mContext.getResources().getDrawable(resId);
-    photo.setAutoMirrored(true);
-    return photo;
-  }
-
   private boolean shouldShowEndCallButton(DialerCall primary, int callState) {
     if (primary == null) {
       return false;
diff --git a/java/com/android/incallui/ContactInfoCache.java b/java/com/android/incallui/ContactInfoCache.java
index 4c8ede9..e45eb97 100644
--- a/java/com/android/incallui/ContactInfoCache.java
+++ b/java/com/android/incallui/ContactInfoCache.java
@@ -84,7 +84,6 @@
   private final ConcurrentHashMap<String, ContactCacheEntry> mInfoMap = new ConcurrentHashMap<>();
   private final Map<String, Set<ContactInfoCacheCallback>> mCallBacks = new ArrayMap<>();
   private Drawable mDefaultContactPhotoDrawable;
-  private Drawable mConferencePhotoDrawable;
   private int mQueryId;
   private final DialerExecutor<CnapInformationWrapper> cachedNumberLookupExecutor =
       DialerExecutors.createNonUiTaskBuilder(new CachedNumberLookupWorker()).build();
@@ -675,14 +674,6 @@
     return mDefaultContactPhotoDrawable;
   }
 
-  public Drawable getConferenceDrawable() {
-    if (mConferencePhotoDrawable == null) {
-      mConferencePhotoDrawable =
-          mContext.getResources().getDrawable(R.drawable.img_conference_automirrored);
-    }
-    return mConferencePhotoDrawable;
-  }
-
   /** Callback interface for the contact query. */
   public interface ContactInfoCacheCallback {
 
@@ -798,8 +789,7 @@
       maybeUpdateFromCequintCallerId(ci, cw.cnapName, mIsIncoming);
       long time = SystemClock.uptimeMillis() - start;
       Log.d(TAG, "Cequint Caller Id look up takes " + time + " ms.");
-      updateCallerInfoInCacheOnAnyThread(
-          cw.callId, cw.numberPresentation, ci, mIsIncoming, true, mQueryToken);
+      updateCallerInfoInCacheOnAnyThread(cw.callId, cw.numberPresentation, ci, mIsIncoming, true, mQueryToken);
     }
 
     @Override
diff --git a/java/com/android/incallui/ExternalCallNotifier.java b/java/com/android/incallui/ExternalCallNotifier.java
index 6ec94a6..0c2493c 100644
--- a/java/com/android/incallui/ExternalCallNotifier.java
+++ b/java/com/android/incallui/ExternalCallNotifier.java
@@ -338,7 +338,9 @@
         && !call.getDetails()
             .hasProperty(android.telecom.Call.Details.PROPERTY_GENERIC_CONFERENCE)) {
 
-      largeIcon = BitmapFactory.decodeResource(context.getResources(), R.drawable.img_conference);
+      largeIcon =
+          BitmapFactory.decodeResource(
+              context.getResources(), R.drawable.quantum_ic_group_vd_theme_24);
     }
     if (contactInfo.photo != null && (contactInfo.photo instanceof BitmapDrawable)) {
       largeIcon = ((BitmapDrawable) contactInfo.photo).getBitmap();
diff --git a/java/com/android/incallui/InCallPresenter.java b/java/com/android/incallui/InCallPresenter.java
index 9c8120c..2d6d83c 100644
--- a/java/com/android/incallui/InCallPresenter.java
+++ b/java/com/android/incallui/InCallPresenter.java
@@ -24,6 +24,7 @@
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
 import android.support.annotation.VisibleForTesting;
+import android.support.v4.os.UserManagerCompat;
 import android.telecom.Call.Details;
 import android.telecom.DisconnectCause;
 import android.telecom.PhoneAccount;
@@ -37,6 +38,7 @@
 import com.android.contacts.common.compat.CallCompat;
 import com.android.dialer.blocking.FilteredNumberAsyncQueryHandler;
 import com.android.dialer.blocking.FilteredNumberAsyncQueryHandler.OnCheckBlockedListener;
+import com.android.dialer.blocking.FilteredNumberCompat;
 import com.android.dialer.blocking.FilteredNumbersUtil;
 import com.android.dialer.common.LogUtil;
 import com.android.dialer.enrichedcall.EnrichedCallComponent;
@@ -309,7 +311,8 @@
       StatusBarNotifier statusBarNotifier,
       ExternalCallNotifier externalCallNotifier,
       ContactInfoCache contactInfoCache,
-      ProximitySensor proximitySensor) {
+      ProximitySensor proximitySensor,
+      FilteredNumberAsyncQueryHandler filteredNumberQueryHandler) {
     if (mServiceConnected) {
       Log.i(this, "New service connection replacing existing one.");
       if (context != mContext || callList != mCallList) {
@@ -354,7 +357,7 @@
 
     VideoPauseController.getInstance().setUp(this);
 
-    mFilteredQueryHandler = new FilteredNumberAsyncQueryHandler(context);
+    mFilteredQueryHandler = filteredNumberQueryHandler;
     mContext
         .getSystemService(TelephonyManager.class)
         .listen(mPhoneStateListener, PhoneStateListener.LISTEN_CALL_STATE);
@@ -519,6 +522,12 @@
     if (call.getState() != android.telecom.Call.STATE_RINGING) {
       return false;
     }
+    if (!UserManagerCompat.isUserUnlocked(mContext)) {
+      LogUtil.i(
+          "InCallPresenter.shouldAttemptBlocking",
+          "not attempting to block incoming call because user is locked");
+      return false;
+    }
     if (TelecomCallUtil.isEmergencyCall(call)) {
       Log.i(this, "Not attempting to block incoming emergency call");
       return false;
@@ -530,6 +539,12 @@
     if (call.getDetails().hasProperty(CallCompat.Details.PROPERTY_IS_EXTERNAL_CALL)) {
       return false;
     }
+    if (FilteredNumberCompat.useNewFiltering(mContext)) {
+      LogUtil.i(
+          "InCallPresenter.shouldAttemptBlocking",
+          "not attempting to block incoming call because framework blocking is in use");
+      return false;
+    }
     return true;
   }
 
diff --git a/java/com/android/incallui/InCallServiceImpl.java b/java/com/android/incallui/InCallServiceImpl.java
index 4fed014..4ab92a7 100644
--- a/java/com/android/incallui/InCallServiceImpl.java
+++ b/java/com/android/incallui/InCallServiceImpl.java
@@ -22,6 +22,7 @@
 import android.telecom.Call;
 import android.telecom.CallAudioState;
 import android.telecom.InCallService;
+import com.android.dialer.blocking.FilteredNumberAsyncQueryHandler;
 import com.android.incallui.audiomode.AudioModeProvider;
 import com.android.incallui.call.CallList;
 import com.android.incallui.call.ExternalCallList;
@@ -66,14 +67,15 @@
     final ContactInfoCache contactInfoCache = ContactInfoCache.getInstance(context);
     InCallPresenter.getInstance()
         .setUp(
-            getApplicationContext(),
+            context,
             CallList.getInstance(),
             new ExternalCallList(),
             new StatusBarNotifier(context, contactInfoCache),
             new ExternalCallNotifier(context, contactInfoCache),
             contactInfoCache,
             new ProximitySensor(
-                context, AudioModeProvider.getInstance(), new AccelerometerListener(context)));
+                context, AudioModeProvider.getInstance(), new AccelerometerListener(context)),
+            new FilteredNumberAsyncQueryHandler(context));
     InCallPresenter.getInstance().onServiceBind();
     InCallPresenter.getInstance().maybeStartRevealAnimation(intent);
     TelecomAdapter.getInstance().setInCallService(this);
diff --git a/java/com/android/incallui/StatusBarNotifier.java b/java/com/android/incallui/StatusBarNotifier.java
index af541b0..165b30b 100644
--- a/java/com/android/incallui/StatusBarNotifier.java
+++ b/java/com/android/incallui/StatusBarNotifier.java
@@ -33,8 +33,8 @@
 import android.app.PendingIntent;
 import android.content.Context;
 import android.content.Intent;
+import android.content.res.Resources;
 import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
 import android.graphics.drawable.BitmapDrawable;
 import android.graphics.drawable.Drawable;
 import android.graphics.drawable.Icon;
@@ -302,7 +302,7 @@
 
     // Check if data has changed; if nothing is different, don't issue another notification.
     final int iconResId = getIconToDisplay(call);
-    Bitmap largeIcon = getLargeIconToDisplay(contactInfo, call);
+    Bitmap largeIcon = getLargeIconToDisplay(mContext, contactInfo, call);
     final String content = getContentString(call, contactInfo.userType);
     final String contentTitle = getContentTitle(contactInfo, call);
 
@@ -594,30 +594,29 @@
   }
 
   /** Gets a large icon from the contact info object to display in the notification. */
-  private Bitmap getLargeIconToDisplay(ContactCacheEntry contactInfo, DialerCall call) {
+  private static Bitmap getLargeIconToDisplay(
+      Context context, ContactCacheEntry contactInfo, DialerCall call) {
+    Resources resources = context.getResources();
     Bitmap largeIcon = null;
-    if (call.isConferenceCall() && !call.hasProperty(Details.PROPERTY_GENERIC_CONFERENCE)) {
-      largeIcon = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.img_conference);
-    }
     if (contactInfo.photo != null && (contactInfo.photo instanceof BitmapDrawable)) {
       largeIcon = ((BitmapDrawable) contactInfo.photo).getBitmap();
     }
     if (contactInfo.photo == null) {
-      int width =
-          (int) mContext.getResources().getDimension(android.R.dimen.notification_large_icon_width);
-      int height =
-          (int)
-              mContext.getResources().getDimension(android.R.dimen.notification_large_icon_height);
+      int width = (int) resources.getDimension(android.R.dimen.notification_large_icon_width);
+      int height = (int) resources.getDimension(android.R.dimen.notification_large_icon_height);
       int contactType = LetterTileDrawable.TYPE_DEFAULT;
-      LetterTileDrawable lettertile = new LetterTileDrawable(mContext.getResources());
+      LetterTileDrawable lettertile = new LetterTileDrawable(resources);
 
       // TODO: Deduplicate across Dialer. b/36195917
-      if (CallerInfoUtils.isVoiceMailNumber(mContext, call)) {
+      if (CallerInfoUtils.isVoiceMailNumber(context, call)) {
         contactType = LetterTileDrawable.TYPE_VOICEMAIL;
       } else if (contactInfo.isBusiness) {
         contactType = LetterTileDrawable.TYPE_BUSINESS;
       } else if (call.getNumberPresentation() == TelecomManager.PRESENTATION_RESTRICTED) {
         contactType = LetterTileDrawable.TYPE_GENERIC_AVATAR;
+      } else if (call.isConferenceCall()
+          && !call.hasProperty(Details.PROPERTY_GENERIC_CONFERENCE)) {
+        contactType = LetterTileDrawable.TYPE_CONFERENCE;
       }
       lettertile.setCanonicalDialerLetterTileDetails(
           contactInfo.namePrimary == null ? contactInfo.number : contactInfo.namePrimary,
@@ -628,8 +627,7 @@
     }
 
     if (call.isSpam()) {
-      Drawable drawable =
-          mContext.getResources().getDrawable(R.drawable.blocked_contact, mContext.getTheme());
+      Drawable drawable = resources.getDrawable(R.drawable.blocked_contact, context.getTheme());
       largeIcon = DrawableConverter.drawableToBitmap(drawable);
     }
     return largeIcon;
diff --git a/java/com/android/incallui/contactgrid/ContactGridManager.java b/java/com/android/incallui/contactgrid/ContactGridManager.java
index ed533be..1322d58 100644
--- a/java/com/android/incallui/contactgrid/ContactGridManager.java
+++ b/java/com/android/incallui/contactgrid/ContactGridManager.java
@@ -245,6 +245,8 @@
       return LetterTileDrawable.TYPE_BUSINESS;
     } else if (primaryInfo.numberPresentation == TelecomManager.PRESENTATION_RESTRICTED) {
       return LetterTileDrawable.TYPE_GENERIC_AVATAR;
+    } else if (callState.isConference) {
+      return LetterTileDrawable.TYPE_CONFERENCE;
     } else {
       return LetterTileDrawable.TYPE_DEFAULT;
     }
diff --git a/java/com/android/voicemail/impl/sync/OmtpVvmSyncService.java b/java/com/android/voicemail/impl/sync/OmtpVvmSyncService.java
index 3443737..7933883 100644
--- a/java/com/android/voicemail/impl/sync/OmtpVvmSyncService.java
+++ b/java/com/android/voicemail/impl/sync/OmtpVvmSyncService.java
@@ -269,7 +269,9 @@
     }
 
     if (readVoicemails.size() > 0) {
+      VvmLog.i(TAG, "Marking voicemails as read");
       if (imapHelper.markMessagesAsRead(readVoicemails)) {
+        VvmLog.i(TAG, "Marking voicemails as clean");
         mQueryHelper.markCleanInDatabase(readVoicemails);
       } else {
         success = false;
@@ -306,7 +308,7 @@
       if (remoteVoicemail == null) {
         mQueryHelper.deleteNonArchivedFromDatabase(localVoicemail);
       } else {
-        if (remoteVoicemail.isRead() != localVoicemail.isRead()) {
+        if (remoteVoicemail.isRead() && !localVoicemail.isRead()) {
           mQueryHelper.markReadInDatabase(localVoicemail);
         }
 
