diff options
Diffstat (limited to 'java/com/android/dialer/historyitemactions/BlockReportSpamModules.java')
-rw-r--r-- | java/com/android/dialer/historyitemactions/BlockReportSpamModules.java | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/java/com/android/dialer/historyitemactions/BlockReportSpamModules.java b/java/com/android/dialer/historyitemactions/BlockReportSpamModules.java index 396c03376..c47b097b7 100644 --- a/java/com/android/dialer/historyitemactions/BlockReportSpamModules.java +++ b/java/com/android/dialer/historyitemactions/BlockReportSpamModules.java @@ -19,6 +19,9 @@ package com.android.dialer.historyitemactions; import android.content.Context; import com.android.dialer.blockreportspam.BlockReportSpamDialogInfo; import com.android.dialer.blockreportspam.ShowBlockReportSpamDialogNotifier; +import com.android.dialer.logging.DialerImpression; +import com.android.dialer.logging.Logger; +import java.util.Optional; /** Modules for blocking/unblocking a number and/or reporting it as spam/not spam. */ final class BlockReportSpamModules { @@ -26,7 +29,9 @@ final class BlockReportSpamModules { private BlockReportSpamModules() {} static HistoryItemActionModule moduleForMarkingNumberAsNotSpam( - Context context, BlockReportSpamDialogInfo blockReportSpamDialogInfo) { + Context context, + BlockReportSpamDialogInfo blockReportSpamDialogInfo, + Optional<DialerImpression.Type> impression) { return new HistoryItemActionModule() { @Override @@ -43,13 +48,17 @@ final class BlockReportSpamModules { public boolean onClick() { ShowBlockReportSpamDialogNotifier.notifyShowDialogToReportNotSpam( context, blockReportSpamDialogInfo); + + impression.ifPresent(Logger.get(context)::logImpression); return true; // Close the bottom sheet. } }; } static HistoryItemActionModule moduleForBlockingNumber( - Context context, BlockReportSpamDialogInfo blockReportSpamDialogInfo) { + Context context, + BlockReportSpamDialogInfo blockReportSpamDialogInfo, + Optional<DialerImpression.Type> impression) { return new HistoryItemActionModule() { @Override @@ -66,13 +75,17 @@ final class BlockReportSpamModules { public boolean onClick() { ShowBlockReportSpamDialogNotifier.notifyShowDialogToBlockNumber( context, blockReportSpamDialogInfo); + + impression.ifPresent(Logger.get(context)::logImpression); return true; // Close the bottom sheet. } }; } static HistoryItemActionModule moduleForUnblockingNumber( - Context context, BlockReportSpamDialogInfo blockReportSpamDialogInfo) { + Context context, + BlockReportSpamDialogInfo blockReportSpamDialogInfo, + Optional<DialerImpression.Type> impression) { return new HistoryItemActionModule() { @Override @@ -90,13 +103,16 @@ final class BlockReportSpamModules { ShowBlockReportSpamDialogNotifier.notifyShowDialogToUnblockNumber( context, blockReportSpamDialogInfo); + impression.ifPresent(Logger.get(context)::logImpression); return true; // Close the bottom sheet. } }; } static HistoryItemActionModule moduleForBlockingNumberAndOptionallyReportingSpam( - Context context, BlockReportSpamDialogInfo blockReportSpamDialogInfo) { + Context context, + BlockReportSpamDialogInfo blockReportSpamDialogInfo, + Optional<DialerImpression.Type> impression) { return new HistoryItemActionModule() { @Override @@ -113,6 +129,8 @@ final class BlockReportSpamModules { public boolean onClick() { ShowBlockReportSpamDialogNotifier.notifyShowDialogToBlockNumberAndOptionallyReportSpam( context, blockReportSpamDialogInfo); + + impression.ifPresent(Logger.get(context)::logImpression); return true; // Close the bottom sheet. } }; |