Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 999b5d5a authored by linyuh's avatar linyuh Committed by Copybara-Service
Browse files

Log contact source when reporting spam from the new UI.

Bug: 73780748
Test: PhoneLookupInfoConsolidatorTest
PiperOrigin-RevId: 187404074
Change-Id: I1db81304909fbf63aba00088c12e18922042c3b1
parent c267ce51
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import com.android.dialer.blockreportspam.BlockReportSpamDialogs.OnConfirmListen
import com.android.dialer.blockreportspam.BlockReportSpamDialogs.OnSpamDialogClickListener;
import com.android.dialer.common.Assert;
import com.android.dialer.common.LogUtil;
import com.android.dialer.logging.ContactSource;
import com.android.dialer.logging.DialerImpression;
import com.android.dialer.logging.Logger;
import com.android.dialer.protos.ProtoParsers;
@@ -109,7 +108,7 @@ public final class ShowBlockReportSpamDialogReceiver extends BroadcastReceiver {
                dialogInfo.getCountryIso(),
                dialogInfo.getCallType(),
                dialogInfo.getReportingLocation(),
                ContactSource.Type.UNKNOWN_SOURCE_TYPE /* TODO(a bug): Fix. */);
                dialogInfo.getContactSource());
          }

          // TODO(a bug): Block the number.
@@ -154,7 +153,7 @@ public final class ShowBlockReportSpamDialogReceiver extends BroadcastReceiver {
                dialogInfo.getCountryIso(),
                dialogInfo.getCallType(),
                dialogInfo.getReportingLocation(),
                ContactSource.Type.UNKNOWN_SOURCE_TYPE /* TODO(a bug): Fix. */);
                dialogInfo.getContactSource());
          }
        };

+5 −1
Original line number Diff line number Diff line
@@ -7,11 +7,12 @@ option optimize_for = LITE_RUNTIME;

package com.android.dialer.blockreportspam;

import "java/com/android/dialer/logging/contact_source.proto";
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
// Next ID: 6
message BlockReportSpamDialogInfo {
  // A dialer-normalized version of the number used in the dialogs.
  // See DialerPhoneNumber#normalized_number.
@@ -27,4 +28,7 @@ message BlockReportSpamDialogInfo {
  // The location where the number is reported.
  optional com.android.dialer.logging.ReportingLocation.Type
      reporting_location = 4;

  // The source where contact info is associated with the number.
  optional com.android.dialer.logging.ContactSource.Type contact_source = 5;
}
 No newline at end of file
+6 −1
Original line number Diff line number Diff line
@@ -21,8 +21,10 @@ option optimize_for = LITE_RUNTIME;

package com.android.dialer;

import "java/com/android/dialer/logging/contact_source.proto";

// Information related to the phone number of the call.
// Next ID: 12
// Next ID: 13
message NumberAttributes {
  // The name (which may be a person's name or business name, but not a number)
  // formatted exactly as it should appear to the user. If the user's locale or
@@ -65,4 +67,7 @@ message NumberAttributes {

  // Whether the number is spam.
  optional bool is_spam = 11;

  // Source of the contact associated with the number.
  optional com.android.dialer.logging.ContactSource.Type contact_source = 12;
}
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -90,6 +90,7 @@ final class Modules {
              .setCountryIso(row.number().getCountryIso())
              .setCallType(row.callType())
              .setReportingLocation(ReportingLocation.Type.CALL_LOG_HISTORY)
              .setContactSource(row.numberAttributes().getContactSource())
              .build();
      modules.addAll(
          SharedModules.createModulesHandlingBlockedOrSpamNumber(
+2 −1
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ public final class NumberAttributesConverter {
        .setIsBlocked(phoneLookupInfoConsolidator.isBlocked())
        .setIsSpam(phoneLookupInfoConsolidator.isSpam())
        .setCanReportAsInvalidNumber(phoneLookupInfoConsolidator.canReportAsInvalidNumber())
        .setIsCp2InfoIncomplete(phoneLookupInfoConsolidator.isDefaultCp2InfoIncomplete());
        .setIsCp2InfoIncomplete(phoneLookupInfoConsolidator.isDefaultCp2InfoIncomplete())
        .setContactSource(phoneLookupInfoConsolidator.getContactSource());
  }
}
Loading