diff --git a/java/com/android/dialer/blockreportspam/ShowBlockReportSpamDialogNotifier.java b/java/com/android/dialer/blockreportspam/ShowBlockReportSpamDialogNotifier.java
index fd81568..58e1988 100644
--- a/java/com/android/dialer/blockreportspam/ShowBlockReportSpamDialogNotifier.java
+++ b/java/com/android/dialer/blockreportspam/ShowBlockReportSpamDialogNotifier.java
@@ -20,7 +20,7 @@
 import android.content.Intent;
 import android.support.v4.content.LocalBroadcastManager;
 import com.android.dialer.common.LogUtil;
-import com.android.dialer.logging.ReportingLocation;
+import com.android.dialer.protos.ProtoParsers;
 
 /**
  * Notifies that a dialog for blocking a number and/or marking it as spam/not spam should be shown.
@@ -31,20 +31,9 @@
 
   /**
    * Notifies that a dialog for blocking a number and optionally report it as spam should be shown.
-   *
-   * @param context Context
-   * @param normalizedNumber The number to be blocked/marked as spam
-   * @param countryIso The ISO 3166-1 two letters country code for the number
-   * @param callType Call type defined in {@link android.provider.CallLog.Calls}
-   * @param reportingLocation The location where the number is reported. See {@link
-   *     ReportingLocation.Type}.
    */
   public static void notifyShowDialogToBlockNumberAndOptionallyReportSpam(
-      Context context,
-      String normalizedNumber,
-      String countryIso,
-      int callType,
-      ReportingLocation.Type reportingLocation) {
+      Context context, BlockReportSpamDialogInfo blockReportSpamDialogInfo) {
     LogUtil.enterBlock(
         "ShowBlockReportSpamDialogNotifier.notifyShowDialogToBlockNumberAndOptionallyReportSpam");
 
@@ -52,40 +41,21 @@
     intent.setAction(
         ShowBlockReportSpamDialogReceiver
             .ACTION_SHOW_DIALOG_TO_BLOCK_NUMBER_AND_OPTIONALLY_REPORT_SPAM);
-
-    intent.putExtra(ShowBlockReportSpamDialogReceiver.EXTRA_NUMBER, normalizedNumber);
-    intent.putExtra(ShowBlockReportSpamDialogReceiver.EXTRA_COUNTRY_ISO, countryIso);
-    intent.putExtra(ShowBlockReportSpamDialogReceiver.EXTRA_CALL_TYPE, callType);
-    intent.putExtra(
-        ShowBlockReportSpamDialogReceiver.EXTRA_REPORTING_LOCATION, reportingLocation.getNumber());
+    ProtoParsers.put(
+        intent, ShowBlockReportSpamDialogReceiver.EXTRA_DIALOG_INFO, blockReportSpamDialogInfo);
 
     LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
   }
 
-  /**
-   * Notifies that a dialog for reporting a number as not spam should be shown.
-   *
-   * @param context Context
-   * @param normalizedNumber The number to be reported as not spam
-   * @param countryIso The ISO 3166-1 two letters country code for the number
-   * @param callType Call type defined in {@link android.provider.CallLog.Calls}
-   * @param reportingLocation The location where the number is reported. See {@link
-   *     ReportingLocation.Type}.
-   */
+  /** Notifies that a dialog for reporting a number as not spam should be shown. */
   public static void notifyShowDialogToReportNotSpam(
-      Context context,
-      String normalizedNumber,
-      String countryIso,
-      int callType,
-      ReportingLocation.Type reportingLocation) {
+      Context context, BlockReportSpamDialogInfo blockReportSpamDialogInfo) {
     LogUtil.enterBlock("ShowBlockReportSpamDialogNotifier.notifyShowDialogToReportNotSpam");
 
     Intent intent = new Intent();
     intent.setAction(ShowBlockReportSpamDialogReceiver.ACTION_SHOW_DIALOG_TO_REPORT_NOT_SPAM);
-    intent.putExtra(ShowBlockReportSpamDialogReceiver.EXTRA_NUMBER, normalizedNumber);
-    intent.putExtra(ShowBlockReportSpamDialogReceiver.EXTRA_COUNTRY_ISO, countryIso);
-    intent.putExtra(ShowBlockReportSpamDialogReceiver.EXTRA_CALL_TYPE, callType);
-    intent.putExtra(ShowBlockReportSpamDialogReceiver.EXTRA_REPORTING_LOCATION, reportingLocation);
+    ProtoParsers.put(
+        intent, ShowBlockReportSpamDialogReceiver.EXTRA_DIALOG_INFO, blockReportSpamDialogInfo);
 
     LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
   }
diff --git a/java/com/android/dialer/blockreportspam/ShowBlockReportSpamDialogReceiver.java b/java/com/android/dialer/blockreportspam/ShowBlockReportSpamDialogReceiver.java
index 75b6241..364736e 100644
--- a/java/com/android/dialer/blockreportspam/ShowBlockReportSpamDialogReceiver.java
+++ b/java/com/android/dialer/blockreportspam/ShowBlockReportSpamDialogReceiver.java
@@ -29,7 +29,7 @@
 import com.android.dialer.logging.ContactSource;
 import com.android.dialer.logging.DialerImpression;
 import com.android.dialer.logging.Logger;
-import com.android.dialer.logging.ReportingLocation;
+import com.android.dialer.protos.ProtoParsers;
 import com.android.dialer.spam.Spam;
 import com.android.dialer.spam.SpamComponent;
 import java.util.Locale;
@@ -43,10 +43,7 @@
   static final String ACTION_SHOW_DIALOG_TO_BLOCK_NUMBER_AND_OPTIONALLY_REPORT_SPAM =
       "show_dialog_to_block_number_and_optionally_report_spam";
   static final String ACTION_SHOW_DIALOG_TO_REPORT_NOT_SPAM = "show_dialog_to_report_not_spam";
-  static final String EXTRA_NUMBER = "number";
-  static final String EXTRA_COUNTRY_ISO = "country_iso";
-  static final String EXTRA_CALL_TYPE = "call_type";
-  static final String EXTRA_REPORTING_LOCATION = "reporting_location";
+  static final String EXTRA_DIALOG_INFO = "dialog_info";
 
   /** {@link FragmentManager} needed to show a {@link android.app.DialogFragment}. */
   private final FragmentManager fragmentManager;
@@ -85,19 +82,10 @@
     LogUtil.enterBlock(
         "ShowBlockReportSpamDialogReceiver.showDialogToBlockNumberAndOptionallyReportSpam");
 
-    Assert.checkArgument(intent.hasExtra(EXTRA_NUMBER));
-    Assert.checkArgument(intent.hasExtra(EXTRA_COUNTRY_ISO));
-    Assert.checkArgument(intent.hasExtra(EXTRA_CALL_TYPE));
-    Assert.checkArgument(intent.hasExtra(EXTRA_REPORTING_LOCATION));
-
-    String normalizedNumber = intent.getStringExtra(EXTRA_NUMBER);
-    String countryIso = intent.getStringExtra(EXTRA_COUNTRY_ISO);
-    int callType = intent.getIntExtra(EXTRA_CALL_TYPE, 0);
-    ReportingLocation.Type reportingLocation =
-        ReportingLocation.Type.forNumber(
-            intent.getIntExtra(
-                EXTRA_REPORTING_LOCATION,
-                ReportingLocation.Type.UNKNOWN_REPORTING_LOCATION.getNumber()));
+    Assert.checkArgument(intent.hasExtra(EXTRA_DIALOG_INFO));
+    BlockReportSpamDialogInfo dialogInfo =
+        ProtoParsers.getTrusted(
+            intent, EXTRA_DIALOG_INFO, BlockReportSpamDialogInfo.getDefaultInstance());
 
     Spam spam = SpamComponent.get(context).spam();
 
@@ -117,24 +105,27 @@
                     DialerImpression.Type
                         .REPORT_CALL_AS_SPAM_VIA_CALL_LOG_BLOCK_REPORT_SPAM_SENT_VIA_BLOCK_NUMBER_DIALOG);
             spam.reportSpamFromCallHistory(
-                normalizedNumber,
-                countryIso,
-                callType,
-                reportingLocation,
+                dialogInfo.getNormalizedNumber(),
+                dialogInfo.getCountryIso(),
+                dialogInfo.getCallType(),
+                dialogInfo.getReportingLocation(),
                 ContactSource.Type.UNKNOWN_SOURCE_TYPE /* TODO(a bug): Fix. */);
           }
 
           // TODO(a bug): Block the number.
           Toast.makeText(
                   context,
-                  String.format(Locale.ENGLISH, "TODO: " + "Block number %s.", normalizedNumber),
+                  String.format(
+                      Locale.ENGLISH,
+                      "TODO: " + "Block number %s.",
+                      dialogInfo.getNormalizedNumber()),
                   Toast.LENGTH_SHORT)
               .show();
         };
 
     // Create and show the dialog.
     BlockReportSpamDialogs.BlockReportSpamDialogFragment.newInstance(
-            normalizedNumber,
+            dialogInfo.getNormalizedNumber(),
             spam.isDialogReportSpamCheckedByDefault(),
             onSpamDialogClickListener,
             /* dismissListener = */ null)
@@ -144,19 +135,10 @@
   private void showDialogToReportNotSpam(Context context, Intent intent) {
     LogUtil.enterBlock("ShowBlockReportSpamDialogReceiver.showDialogToReportNotSpam");
 
-    Assert.checkArgument(intent.hasExtra(EXTRA_NUMBER));
-    Assert.checkArgument(intent.hasExtra(EXTRA_COUNTRY_ISO));
-    Assert.checkArgument(intent.hasExtra(EXTRA_CALL_TYPE));
-    Assert.checkArgument(intent.hasExtra(EXTRA_REPORTING_LOCATION));
-
-    String normalizedNumber = intent.getStringExtra(EXTRA_NUMBER);
-    String countryIso = intent.getStringExtra(EXTRA_COUNTRY_ISO);
-    int callType = intent.getIntExtra(EXTRA_CALL_TYPE, 0);
-    ReportingLocation.Type reportingLocation =
-        ReportingLocation.Type.forNumber(
-            intent.getIntExtra(
-                EXTRA_REPORTING_LOCATION,
-                ReportingLocation.Type.UNKNOWN_REPORTING_LOCATION.getNumber()));
+    Assert.checkArgument(intent.hasExtra(EXTRA_DIALOG_INFO));
+    BlockReportSpamDialogInfo dialogInfo =
+        ProtoParsers.getTrusted(
+            intent, EXTRA_DIALOG_INFO, BlockReportSpamDialogInfo.getDefaultInstance());
 
     // Set up the positive listener for the dialog.
     OnConfirmListener onConfirmListener =
@@ -168,17 +150,17 @@
             Logger.get(context)
                 .logImpression(DialerImpression.Type.DIALOG_ACTION_CONFIRM_NUMBER_NOT_SPAM);
             spam.reportNotSpamFromCallHistory(
-                normalizedNumber,
-                countryIso,
-                callType,
-                reportingLocation,
+                dialogInfo.getNormalizedNumber(),
+                dialogInfo.getCountryIso(),
+                dialogInfo.getCallType(),
+                dialogInfo.getReportingLocation(),
                 ContactSource.Type.UNKNOWN_SOURCE_TYPE /* TODO(a bug): Fix. */);
           }
         };
 
     // Create & show the dialog.
     BlockReportSpamDialogs.ReportNotSpamDialogFragment.newInstance(
-            normalizedNumber, onConfirmListener, /* dismissListener = */ null)
+            dialogInfo.getNormalizedNumber(), onConfirmListener, /* dismissListener = */ null)
         .show(fragmentManager, BlockReportSpamDialogs.NOT_SPAM_DIALOG_TAG);
   }
 }
diff --git a/java/com/android/dialer/blockreportspam/block_report_spam_dialog_info.proto b/java/com/android/dialer/blockreportspam/block_report_spam_dialog_info.proto
new file mode 100644
index 0000000..3c5a616
--- /dev/null
+++ b/java/com/android/dialer/blockreportspam/block_report_spam_dialog_info.proto
@@ -0,0 +1,30 @@
+syntax = "proto2";
+
+option java_package = "com.android.dialer.blockreportspam";
+option java_multiple_files = true;
+option optimize_for = LITE_RUNTIME;
+
+
+package com.android.dialer.blockreportspam;
+
+import "java/com/android/dialer/logging/reporting_location.proto";
+
+// Contains information needed in dialogs that allow a user to block a number
+// and/or report it as spam/not spam.
+// Next ID: 5
+message BlockReportSpamDialogInfo {
+  // A dialer-normalized version of the number used in the dialogs.
+  // See DialerPhoneNumber#normalized_number.
+  optional string normalized_number = 1;
+
+  // The ISO 3166-1 two letters country code of the number.
+  optional string country_iso = 2;
+
+  // Type of the call to/from the number, as defined in
+  // android.provider.CallLog.Calls
+  optional int32 call_type = 3;
+
+  // The location where the number is reported.
+  optional com.android.dialer.logging.ReportingLocation.Type
+      reporting_location = 4;
+}
\ No newline at end of file
diff --git a/java/com/android/dialer/calllog/ui/menu/Modules.java b/java/com/android/dialer/calllog/ui/menu/Modules.java
index 1479727..9df1223 100644
--- a/java/com/android/dialer/calllog/ui/menu/Modules.java
+++ b/java/com/android/dialer/calllog/ui/menu/Modules.java
@@ -20,6 +20,7 @@
 import android.provider.CallLog.Calls;
 import android.telecom.PhoneAccountHandle;
 import android.text.TextUtils;
+import com.android.dialer.blockreportspam.BlockReportSpamDialogInfo;
 import com.android.dialer.calldetails.CallDetailsActivity;
 import com.android.dialer.callintent.CallInitiationType;
 import com.android.dialer.calllog.model.CoalescedRow;
@@ -83,15 +84,19 @@
         modules.add(moduleForAddingToContacts.get());
       }
 
+      BlockReportSpamDialogInfo blockReportSpamDialogInfo =
+          BlockReportSpamDialogInfo.newBuilder()
+              .setNormalizedNumber(row.number().getNormalizedNumber())
+              .setCountryIso(row.number().getCountryIso())
+              .setCallType(row.callType())
+              .setReportingLocation(ReportingLocation.Type.CALL_LOG_HISTORY)
+              .build();
       modules.addAll(
           SharedModules.createModulesHandlingBlockedOrSpamNumber(
               context,
-              row.number().getNormalizedNumber(),
-              row.number().getCountryIso(),
-              row.callType(),
+              blockReportSpamDialogInfo,
               row.numberAttributes().getIsBlocked(),
-              row.numberAttributes().getIsSpam(),
-              ReportingLocation.Type.CALL_LOG_HISTORY));
+              row.numberAttributes().getIsSpam()));
 
       Optional<HistoryItemActionModule> moduleForCopyingNumber =
           SharedModules.createModuleForCopyingNumber(context, normalizedNumber);
diff --git a/java/com/android/dialer/historyitemactions/SharedModules.java b/java/com/android/dialer/historyitemactions/SharedModules.java
index 7cfee37..c046086 100644
--- a/java/com/android/dialer/historyitemactions/SharedModules.java
+++ b/java/com/android/dialer/historyitemactions/SharedModules.java
@@ -24,9 +24,9 @@
 import android.text.TextUtils;
 import android.widget.Toast;
 import com.android.dialer.DialerPhoneNumber;
+import com.android.dialer.blockreportspam.BlockReportSpamDialogInfo;
 import com.android.dialer.blockreportspam.ShowBlockReportSpamDialogNotifier;
 import com.android.dialer.clipboard.ClipboardUtils;
-import com.android.dialer.logging.ReportingLocation;
 import com.android.dialer.util.IntentUtil;
 import com.android.dialer.util.UriUtils;
 import com.google.common.base.Optional;
@@ -114,63 +114,42 @@
   }
 
   /**
-   * Add modules related to blocking/unblocking a number and/or reporting it as spam/not spam.
-   *
-   * @param normalizedNumber The number to be blocked / unblocked / marked as spam/not spam
-   * @param countryIso The ISO 3166-1 two letters country code for the number
-   * @param callType Call type defined in {@link android.provider.CallLog.Calls}
-   * @param reportingLocation The location where the number is reported. See {@link
-   *     ReportingLocation.Type}.
+   * Create modules related to blocking/unblocking a number and/or reporting it as spam/not spam.
    */
   public static List<HistoryItemActionModule> createModulesHandlingBlockedOrSpamNumber(
       Context context,
-      String normalizedNumber,
-      String countryIso,
-      int callType,
+      BlockReportSpamDialogInfo blockReportSpamDialogInfo,
       boolean isBlocked,
-      boolean isSpam,
-      ReportingLocation.Type reportingLocation) {
+      boolean isSpam) {
     List<HistoryItemActionModule> modules = new ArrayList<>();
 
     // For a spam number, add two options:
     // (1) "Not spam" and "Block", or
     // (2) "Not spam" and "Unblock".
     if (isSpam) {
+      modules.add(createModuleForMarkingNumberAsNonSpam(context, blockReportSpamDialogInfo));
       modules.add(
-          createModuleForMarkingNumberAsNonSpam(
-              context, normalizedNumber, countryIso, callType, reportingLocation));
-      modules.add(createModuleForBlockingOrUnblockingNumber(context, normalizedNumber, isBlocked));
+          createModuleForBlockingOrUnblockingNumber(context, blockReportSpamDialogInfo, isBlocked));
       return modules;
     }
 
     // For a blocked non-spam number, add "Unblock" option.
     if (isBlocked) {
-      modules.add(createModuleForBlockingOrUnblockingNumber(context, normalizedNumber, isBlocked));
+      modules.add(
+          createModuleForBlockingOrUnblockingNumber(context, blockReportSpamDialogInfo, isBlocked));
       return modules;
     }
 
     // For a number that is neither a spam number nor blocked, add "Block/Report spam" option.
     modules.add(
         createModuleForBlockingNumberAndOptionallyReportingSpam(
-            context, normalizedNumber, countryIso, callType, reportingLocation));
+            context, blockReportSpamDialogInfo));
     return modules;
   }
 
-  /**
-   * Add "Not spam" module.
-   *
-   * @param normalizedNumber The number to be marked as not spam
-   * @param countryIso The ISO 3166-1 two letters country code for the number
-   * @param callType Call type defined in {@link android.provider.CallLog.Calls}
-   * @param reportingLocation The location where the number is reported. See {@link
-   *     ReportingLocation.Type}.
-   */
+  /** Create "Not spam" module. */
   private static HistoryItemActionModule createModuleForMarkingNumberAsNonSpam(
-      Context context,
-      String normalizedNumber,
-      String countryIso,
-      int callType,
-      ReportingLocation.Type reportingLocation) {
+      Context context, BlockReportSpamDialogInfo blockReportSpamDialogInfo) {
     return new HistoryItemActionModule() {
       @Override
       public int getStringId() {
@@ -185,14 +164,14 @@
       @Override
       public boolean onClick() {
         ShowBlockReportSpamDialogNotifier.notifyShowDialogToReportNotSpam(
-            context, normalizedNumber, countryIso, callType, reportingLocation);
+            context, blockReportSpamDialogInfo);
         return true; // Close the bottom sheet.
       }
     };
   }
 
   private static HistoryItemActionModule createModuleForBlockingOrUnblockingNumber(
-      Context context, String normalizedNumber, boolean isBlocked) {
+      Context context, BlockReportSpamDialogInfo blockReportSpamDialogInfo, boolean isBlocked) {
     return new HistoryItemActionModule() {
       @Override
       public int getStringId() {
@@ -214,7 +193,7 @@
                 String.format(
                     Locale.ENGLISH,
                     "TODO: " + (isBlocked ? "Unblock " : "Block ") + " number %s.",
-                    normalizedNumber),
+                    blockReportSpamDialogInfo.getNormalizedNumber()),
                 Toast.LENGTH_SHORT)
             .show();
         return true; // Close the bottom sheet.
@@ -222,21 +201,9 @@
     };
   }
 
-  /**
-   * Add "Block/Report spam" module
-   *
-   * @param normalizedNumber The number to be blocked / unblocked / marked as spam/not spam
-   * @param countryIso The ISO 3166-1 two letters country code for the number
-   * @param callType Call type defined in {@link android.provider.CallLog.Calls}
-   * @param reportingLocation The location where the number is reported. See {@link
-   *     ReportingLocation.Type}.
-   */
+  /** Create "Block/Report spam" module */
   private static HistoryItemActionModule createModuleForBlockingNumberAndOptionallyReportingSpam(
-      Context context,
-      String normalizedNumber,
-      String countryIso,
-      int callType,
-      ReportingLocation.Type reportingLocation) {
+      Context context, BlockReportSpamDialogInfo blockReportSpamDialogInfo) {
     return new HistoryItemActionModule() {
       @Override
       public int getStringId() {
@@ -251,7 +218,7 @@
       @Override
       public boolean onClick() {
         ShowBlockReportSpamDialogNotifier.notifyShowDialogToBlockNumberAndOptionallyReportSpam(
-            context, normalizedNumber, countryIso, callType, reportingLocation);
+            context, blockReportSpamDialogInfo);
         return true; // Close the bottom sheet.
       }
     };
diff --git a/java/com/android/dialer/voicemail/listui/menu/Modules.java b/java/com/android/dialer/voicemail/listui/menu/Modules.java
index 9473b80..cc7bcbe 100644
--- a/java/com/android/dialer/voicemail/listui/menu/Modules.java
+++ b/java/com/android/dialer/voicemail/listui/menu/Modules.java
@@ -17,6 +17,7 @@
 package com.android.dialer.voicemail.listui.menu;
 
 import android.content.Context;
+import com.android.dialer.blockreportspam.BlockReportSpamDialogInfo;
 import com.android.dialer.historyitemactions.DividerModule;
 import com.android.dialer.historyitemactions.HistoryItemActionModule;
 import com.android.dialer.historyitemactions.SharedModules;
@@ -64,15 +65,19 @@
       modules.add(new DividerModule());
     }
 
+    BlockReportSpamDialogInfo blockReportSpamDialogInfo =
+        BlockReportSpamDialogInfo.newBuilder()
+            .setNormalizedNumber(voicemailEntry.number().getNormalizedNumber())
+            .setCountryIso(voicemailEntry.number().getCountryIso())
+            .setCallType(voicemailEntry.callType())
+            .setReportingLocation(ReportingLocation.Type.VOICEMAIL_HISTORY)
+            .build();
     modules.addAll(
         SharedModules.createModulesHandlingBlockedOrSpamNumber(
             context,
-            voicemailEntry.number().getNormalizedNumber(),
-            voicemailEntry.number().getCountryIso(),
-            voicemailEntry.callType(),
+            blockReportSpamDialogInfo,
             voicemailEntry.numberAttributes().getIsBlocked(),
-            voicemailEntry.numberAttributes().getIsSpam(),
-            ReportingLocation.Type.VOICEMAIL_HISTORY));
+            voicemailEntry.numberAttributes().getIsSpam()));
 
     // TODO(zachh): Module for CallComposer.
     Optional<HistoryItemActionModule> moduleForCopyingNumber =
