diff options
author | erfanian <erfanian@google.com> | 2018-06-27 13:23:52 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-06-27 13:23:52 -0700 |
commit | 7d89eba834b63fa6aed56281e8cb42bf4ddeb42a (patch) | |
tree | 01e38ce193839566d6023da595630f06233b94cc /java/com/android/dialer/historyitemactions/BlockReportSpamModules.java | |
parent | a582e75614b8bcfc6849f83641575a4540afab45 (diff) | |
parent | 517572cd4de887daf129eb8b11ad9e4b5a534744 (diff) |
Merge changes I277fcbc7,Idcf29c93 am: 92fb805602 am: 6c0a406956
am: 517572cd4d
Change-Id: I88ca15c86095328a9cef8a38f9fc16b6bcc4aba8
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. } }; |