summaryrefslogtreecommitdiff
path: root/src/com/android/dialer
diff options
context:
space:
mode:
authorSarmad Hashmi <mhashmi@google.com>2016-04-14 20:38:08 -0700
committerSarmad Hashmi <mhashmi@google.com>2016-04-15 17:18:24 -0700
commitf05c8f7c3f7e8d3a91f4c092b73dc5edb67d664b (patch)
treee5edc5aabf2ef0764b59e82b5e5cd90a1d354bd8 /src/com/android/dialer
parentf40b8dbaddde6136d49b3115584e47a8207c6220 (diff)
Update ExtendedCallInfoService reporting methods to accept location.
+Add IntDef which contains all the possible locations numbers can be reported as spam or not spam from. +Updated method calls to include location BUG=27323295 Change-Id: I549e439af328447fbbf0c61116cdff9b1b877334
Diffstat (limited to 'src/com/android/dialer')
-rw-r--r--src/com/android/dialer/calllog/BlockReportSpamListener.java12
-rw-r--r--src/com/android/dialer/service/ExtendedCallInfoService.java23
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);
}