Merge changes I59d70b96,If166951b

* changes:
  Set the correct reporting location when reporting spam in the new call log.
  Bump version codes and name to v19
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 0653fe4..164dbc9 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -16,8 +16,8 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
   coreApp="true"
   package="com.android.dialer"
-  android:versionCode="240000"
-  android:versionName="18.0">
+  android:versionCode="250000"
+  android:versionName="19.0">
 
   <uses-sdk
     android:minSdkVersion="23"
diff --git a/java/com/android/dialer/binary/google/AndroidManifest.xml b/java/com/android/dialer/binary/google/AndroidManifest.xml
index f7c5643..c1f1a59 100644
--- a/java/com/android/dialer/binary/google/AndroidManifest.xml
+++ b/java/com/android/dialer/binary/google/AndroidManifest.xml
@@ -16,8 +16,8 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
   coreApp="true"
   package="com.google.android.google_stub_dialer"
-  android:versionCode="240000"
-  android:versionName="18.0">
+  android:versionCode="250000"
+  android:versionName="19.0">
 
   <uses-sdk
     android:minSdkVersion="23"
diff --git a/java/com/android/dialer/blockreportspam/ShowBlockReportSpamDialogNotifier.java b/java/com/android/dialer/blockreportspam/ShowBlockReportSpamDialogNotifier.java
index fd6a807..fd81568 100644
--- a/java/com/android/dialer/blockreportspam/ShowBlockReportSpamDialogNotifier.java
+++ b/java/com/android/dialer/blockreportspam/ShowBlockReportSpamDialogNotifier.java
@@ -20,6 +20,7 @@
 import android.content.Intent;
 import android.support.v4.content.LocalBroadcastManager;
 import com.android.dialer.common.LogUtil;
+import com.android.dialer.logging.ReportingLocation;
 
 /**
  * Notifies that a dialog for blocking a number and/or marking it as spam/not spam should be shown.
@@ -35,9 +36,15 @@
    * @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) {
+      Context context,
+      String normalizedNumber,
+      String countryIso,
+      int callType,
+      ReportingLocation.Type reportingLocation) {
     LogUtil.enterBlock(
         "ShowBlockReportSpamDialogNotifier.notifyShowDialogToBlockNumberAndOptionallyReportSpam");
 
@@ -49,6 +56,8 @@
     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());
 
     LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
   }
@@ -60,9 +69,15 @@
    * @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}.
    */
   public static void notifyShowDialogToReportNotSpam(
-      Context context, String normalizedNumber, String countryIso, int callType) {
+      Context context,
+      String normalizedNumber,
+      String countryIso,
+      int callType,
+      ReportingLocation.Type reportingLocation) {
     LogUtil.enterBlock("ShowBlockReportSpamDialogNotifier.notifyShowDialogToReportNotSpam");
 
     Intent intent = new Intent();
@@ -70,6 +85,7 @@
     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);
 
     LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
   }
diff --git a/java/com/android/dialer/blockreportspam/ShowBlockReportSpamDialogReceiver.java b/java/com/android/dialer/blockreportspam/ShowBlockReportSpamDialogReceiver.java
index 9642468..75b6241 100644
--- a/java/com/android/dialer/blockreportspam/ShowBlockReportSpamDialogReceiver.java
+++ b/java/com/android/dialer/blockreportspam/ShowBlockReportSpamDialogReceiver.java
@@ -46,6 +46,7 @@
   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";
 
   /** {@link FragmentManager} needed to show a {@link android.app.DialogFragment}. */
   private final FragmentManager fragmentManager;
@@ -87,10 +88,16 @@
     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()));
 
     Spam spam = SpamComponent.get(context).spam();
 
@@ -113,7 +120,7 @@
                 normalizedNumber,
                 countryIso,
                 callType,
-                ReportingLocation.Type.UNKNOWN_REPORTING_LOCATION /* TODO(a bug): Fix. */,
+                reportingLocation,
                 ContactSource.Type.UNKNOWN_SOURCE_TYPE /* TODO(a bug): Fix. */);
           }
 
@@ -140,10 +147,16 @@
     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()));
 
     // Set up the positive listener for the dialog.
     OnConfirmListener onConfirmListener =
@@ -158,7 +171,7 @@
                 normalizedNumber,
                 countryIso,
                 callType,
-                ReportingLocation.Type.UNKNOWN_REPORTING_LOCATION /* TODO(a bug): Fix. */,
+                reportingLocation,
                 ContactSource.Type.UNKNOWN_SOURCE_TYPE /* TODO(a bug): Fix. */);
           }
         };
diff --git a/java/com/android/dialer/calllog/ui/menu/Modules.java b/java/com/android/dialer/calllog/ui/menu/Modules.java
index 48de03e..d86c04d 100644
--- a/java/com/android/dialer/calllog/ui/menu/Modules.java
+++ b/java/com/android/dialer/calllog/ui/menu/Modules.java
@@ -30,6 +30,7 @@
 import com.android.dialer.contactactions.IntentModule;
 import com.android.dialer.contactactions.SharedModules;
 import com.android.dialer.dialercontact.DialerContact;
+import com.android.dialer.logging.ReportingLocation;
 import com.android.dialer.phonenumberutil.PhoneNumberHelper;
 import com.android.dialer.telecom.TelecomUtil;
 import com.google.common.base.Optional;
@@ -79,7 +80,8 @@
           row.number().getCountryIso(),
           row.callType(),
           row.numberAttributes().getIsBlocked(),
-          row.numberAttributes().getIsSpam());
+          row.numberAttributes().getIsSpam(),
+          ReportingLocation.Type.CALL_LOG_HISTORY);
       SharedModules.maybeAddModuleForCopyingNumber(context, modules, normalizedNumber);
     }
 
diff --git a/java/com/android/dialer/contactactions/SharedModules.java b/java/com/android/dialer/contactactions/SharedModules.java
index 0689f98..3007a59 100644
--- a/java/com/android/dialer/contactactions/SharedModules.java
+++ b/java/com/android/dialer/contactactions/SharedModules.java
@@ -26,6 +26,7 @@
 import com.android.dialer.DialerPhoneNumber;
 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 java.util.List;
@@ -118,6 +119,8 @@
    * @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}.
    */
   public static void addModulesHandlingBlockedOrSpamNumber(
       Context context,
@@ -126,12 +129,14 @@
       String countryIso,
       int callType,
       boolean isBlocked,
-      boolean isSpam) {
+      boolean isSpam,
+      ReportingLocation.Type reportingLocation) {
     // For a spam number, add two options:
     // (1) "Not spam" and "Block", or
     // (2) "Not spam" and "Unblock".
     if (isSpam) {
-      addModuleForMarkingNumberAsNonSpam(context, modules, normalizedNumber, countryIso, callType);
+      addModuleForMarkingNumberAsNonSpam(
+          context, modules, normalizedNumber, countryIso, callType, reportingLocation);
       addModuleForBlockingOrUnblockingNumber(context, modules, normalizedNumber, isBlocked);
       return;
     }
@@ -144,7 +149,7 @@
 
     // For a number that is neither a spam number nor blocked, add "Block/Report spam" option.
     addModuleForBlockingNumberAndOptionallyReportingSpam(
-        context, modules, normalizedNumber, countryIso, callType);
+        context, modules, normalizedNumber, countryIso, callType, reportingLocation);
   }
 
   /**
@@ -153,13 +158,16 @@
    * @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}.
    */
   private static void addModuleForMarkingNumberAsNonSpam(
       Context context,
       List<ContactActionModule> modules,
       String normalizedNumber,
       String countryIso,
-      int callType) {
+      int callType,
+      ReportingLocation.Type reportingLocation) {
     modules.add(
         new ContactActionModule() {
           @Override
@@ -175,7 +183,7 @@
           @Override
           public boolean onClick() {
             ShowBlockReportSpamDialogNotifier.notifyShowDialogToReportNotSpam(
-                context, normalizedNumber, countryIso, callType);
+                context, normalizedNumber, countryIso, callType, reportingLocation);
             return true; // Close the bottom sheet.
           }
         });
@@ -222,13 +230,16 @@
    * @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}.
    */
   private static void addModuleForBlockingNumberAndOptionallyReportingSpam(
       Context context,
       List<ContactActionModule> modules,
       String normalizedNumber,
       String countryIso,
-      int callType) {
+      int callType,
+      ReportingLocation.Type reportingLocation) {
     modules.add(
         new ContactActionModule() {
           @Override
@@ -244,7 +255,7 @@
           @Override
           public boolean onClick() {
             ShowBlockReportSpamDialogNotifier.notifyShowDialogToBlockNumberAndOptionallyReportSpam(
-                context, normalizedNumber, countryIso, callType);
+                context, normalizedNumber, countryIso, callType, reportingLocation);
             return true; // Close the bottom sheet.
           }
         });
diff --git a/java/com/android/dialer/logging/reporting_location.proto b/java/com/android/dialer/logging/reporting_location.proto
index 3c1baf0..b9912be 100644
--- a/java/com/android/dialer/logging/reporting_location.proto
+++ b/java/com/android/dialer/logging/reporting_location.proto
@@ -14,5 +14,6 @@
     UNKNOWN_REPORTING_LOCATION = 0;
     CALL_LOG_HISTORY = 1;
     FEEDBACK_PROMPT = 2;
+    VOICEMAIL_HISTORY = 3;
   }
 }
diff --git a/java/com/android/dialer/voicemail/listui/menu/Modules.java b/java/com/android/dialer/voicemail/listui/menu/Modules.java
index 84921bd..76ce172 100644
--- a/java/com/android/dialer/voicemail/listui/menu/Modules.java
+++ b/java/com/android/dialer/voicemail/listui/menu/Modules.java
@@ -20,6 +20,7 @@
 import com.android.dialer.contactactions.ContactActionModule;
 import com.android.dialer.contactactions.DividerModule;
 import com.android.dialer.contactactions.SharedModules;
+import com.android.dialer.logging.ReportingLocation;
 import com.android.dialer.voicemail.model.VoicemailEntry;
 import java.util.ArrayList;
 import java.util.List;
@@ -60,7 +61,8 @@
         voicemailEntry.number().getCountryIso(),
         voicemailEntry.callType(),
         voicemailEntry.numberAttributes().getIsBlocked(),
-        voicemailEntry.numberAttributes().getIsSpam());
+        voicemailEntry.numberAttributes().getIsSpam(),
+        ReportingLocation.Type.VOICEMAIL_HISTORY);
 
     // TODO(zachh): Module for CallComposer.
     SharedModules.maybeAddModuleForCopyingNumber(context, modules, normalizedNumber);