diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/calllog/BlockReportSpamListener.java | 12 | ||||
-rw-r--r-- | src/com/android/dialer/service/ExtendedCallInfoService.java | 23 |
2 files changed, 29 insertions, 6 deletions
diff --git a/src/com/android/dialer/calllog/BlockReportSpamListener.java b/src/com/android/dialer/calllog/BlockReportSpamListener.java index 62b9b9311..92cbc804b 100644 --- a/src/com/android/dialer/calllog/BlockReportSpamListener.java +++ b/src/com/android/dialer/calllog/BlockReportSpamListener.java @@ -41,7 +41,8 @@ public class BlockReportSpamListener implements CallLogListItemViewHolder.OnClic public void onClick(boolean isSpamChecked) { if (isSpamChecked) { mExtendedCallInfoService.reportSpam( - number, countryIso, callType); + number, countryIso, callType, + ExtendedCallInfoService.REPORTING_LOCATION_CALL_LOG_HISTORY); } mFilteredNumberAsyncQueryHandler.blockNumber( new FilteredNumberAsyncQueryHandler.OnBlockNumberListener() { @@ -64,7 +65,8 @@ public class BlockReportSpamListener implements CallLogListItemViewHolder.OnClic new BlockReportSpamDialogs.OnConfirmListener() { @Override public void onClick() { - mExtendedCallInfoService.reportSpam(number, countryIso, callType); + mExtendedCallInfoService.reportSpam(number, countryIso, callType, + ExtendedCallInfoService.REPORTING_LOCATION_CALL_LOG_HISTORY); mFilteredNumberAsyncQueryHandler.blockNumber( new FilteredNumberAsyncQueryHandler.OnBlockNumberListener() { @Override @@ -88,7 +90,8 @@ public class BlockReportSpamListener implements CallLogListItemViewHolder.OnClic public void onClick() { if (isSpam) { mExtendedCallInfoService.reportNotSpam( - number, countryIso, callType); + number, countryIso, callType, + ExtendedCallInfoService.REPORTING_LOCATION_CALL_LOG_HISTORY); } mFilteredNumberAsyncQueryHandler.unblock( new FilteredNumberAsyncQueryHandler.OnUnblockNumberListener() { @@ -111,7 +114,8 @@ public class BlockReportSpamListener implements CallLogListItemViewHolder.OnClic @Override public void onClick() { mExtendedCallInfoService.reportNotSpam( - number, countryIso, callType); + number, countryIso, callType, + ExtendedCallInfoService.REPORTING_LOCATION_CALL_LOG_HISTORY); mAdapter.notifyDataSetChanged(); } }, null) diff --git a/src/com/android/dialer/service/ExtendedCallInfoService.java b/src/com/android/dialer/service/ExtendedCallInfoService.java index 0bf5badd3..5481cc90d 100644 --- a/src/com/android/dialer/service/ExtendedCallInfoService.java +++ b/src/com/android/dialer/service/ExtendedCallInfoService.java @@ -16,10 +16,25 @@ package com.android.dialer.service; +import android.support.annotation.IntDef; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + /** * Interface of service to get extended call information. */ public interface ExtendedCallInfoService { + /** + * All the possible locations that a user can report a number as spam or not spam. + */ + @Retention(RetentionPolicy.SOURCE) + @IntDef({REPORTING_LOCATION_UNKNOWN, REPORTING_LOCATION_CALL_LOG_HISTORY, + REPORTING_LOCATION_FEEDBACK_PROMPT}) + @interface ReportingLocation {} + int REPORTING_LOCATION_UNKNOWN = 0; + int REPORTING_LOCATION_CALL_LOG_HISTORY = 1; + int REPORTING_LOCATION_FEEDBACK_PROMPT = 2; /** * Interface for a callback to be invoked when data is fetched. @@ -46,8 +61,10 @@ public interface ExtendedCallInfoService { * @param countryIso The country ISO of the number. * @param callType Whether the type of call is missed, voicemail, etc. Example of this is * {@link android.provider.CallLog.Calls#VOICEMAIL_TYPE}. + * @param from Where in the dialer this was reported from. + * Must be one of {@link ReportingLocation}. */ - void reportSpam(String number, String countryIso, int callType); + void reportSpam(String number, String countryIso, int callType, @ReportingLocation int from); /** * Reports number as not spam. @@ -55,6 +72,8 @@ public interface ExtendedCallInfoService { * @param countryIso The country ISO of the number. * @param callType Whether the type of call is missed, voicemail, etc. Example of this is * {@link android.provider.CallLog.Calls#VOICEMAIL_TYPE}. + * @param from Where in the dialer this was reported from. + * Must be one of {@link ReportingLocation}. */ - void reportNotSpam(String number, String countryIso, int callType); + void reportNotSpam(String number, String countryIso, int callType, @ReportingLocation int from); } |