Fixed an issue in VoicemailCallFilter process timeouts.
Fixed an issue in VoicemailCallFilter process always timeouts
when a call incoming from anonymous number.
Test: Added two unit tests and did manual testing
Bug: 31353454
Bug: 29415740
Change-Id: I159745c25371996bb22108568b3b42ec37d358c9
diff --git a/src/com/android/server/telecom/CallerInfoLookupHelper.java b/src/com/android/server/telecom/CallerInfoLookupHelper.java
index e557c8a..6276052 100644
--- a/src/com/android/server/telecom/CallerInfoLookupHelper.java
+++ b/src/com/android/server/telecom/CallerInfoLookupHelper.java
@@ -16,6 +16,7 @@
package com.android.server.telecom;
+import android.annotation.Nullable;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
@@ -41,7 +42,7 @@
* @param info
* @return true if the value should be cached, false otherwise.
*/
- void onCallerInfoQueryComplete(Uri handle, CallerInfo info);
+ void onCallerInfoQueryComplete(Uri handle, @Nullable CallerInfo info);
void onContactPhotoQueryComplete(Uri handle, CallerInfo info);
}
@@ -54,6 +55,7 @@
listeners = new LinkedList<>();
}
}
+
private final Map<Uri, CallerInfoQueryInfo> mQueryEntries = new HashMap<>();
private final CallerInfoAsyncQueryFactory mCallerInfoAsyncQueryFactory;
@@ -74,11 +76,13 @@
public void startLookup(final Uri handle, OnQueryCompleteListener listener) {
if (handle == null) {
+ listener.onCallerInfoQueryComplete(handle, null);
return;
}
final String number = handle.getSchemeSpecificPart();
if (TextUtils.isEmpty(number)) {
+ listener.onCallerInfoQueryComplete(handle, null);
return;
}