summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/enrichedcall/EnrichedCallManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/com/android/dialer/enrichedcall/EnrichedCallManager.java')
-rw-r--r--java/com/android/dialer/enrichedcall/EnrichedCallManager.java28
1 files changed, 23 insertions, 5 deletions
diff --git a/java/com/android/dialer/enrichedcall/EnrichedCallManager.java b/java/com/android/dialer/enrichedcall/EnrichedCallManager.java
index fa822a659..0d3ed9e43 100644
--- a/java/com/android/dialer/enrichedcall/EnrichedCallManager.java
+++ b/java/com/android/dialer/enrichedcall/EnrichedCallManager.java
@@ -158,7 +158,7 @@ public interface EnrichedCallManager {
/**
* Callback fired when state changes. Listeners should call {@link #getSession(long)} or {@link
- * #getSession(String, String)} to retrieve the new state.
+ * #getSession(String, String, Filter)} to retrieve the new state.
*/
void onEnrichedCallStateChanged();
}
@@ -172,16 +172,25 @@ public interface EnrichedCallManager {
@MainThread
void registerStateChangedListener(@NonNull StateChangedListener listener);
- /** Returns the {@link Session} for the given unique call id, falling back to the number. */
+ /**
+ * Returns the {@link Session} for the given unique call id, falling back to the number. If a
+ * filter is provided, it will be applied to both the uniqueCalId and number lookups.
+ */
@MainThread
@Nullable
- Session getSession(@NonNull String uniqueCallId, @NonNull String number);
+ Session getSession(@NonNull String uniqueCallId, @NonNull String number, @Nullable Filter filter);
/** Returns the {@link Session} for the given sessionId, or {@code null} if no session exists. */
@MainThread
@Nullable
Session getSession(long sessionId);
+ @NonNull
+ Filter createIncomingCallComposerFilter();
+
+ @NonNull
+ Filter createOutgoingCallComposerFilter();
+
/**
* Starts an asynchronous process to get all historical data for the given number and set of
* {@link CallDetailsEntries}.
@@ -265,9 +274,13 @@ public interface EnrichedCallManager {
@MainThread
void unregisterVideoShareListener(@NonNull VideoShareListener listener);
- /** Called when an incoming video share invite is received. */
+ /**
+ * Called when an incoming video share invite is received.
+ *
+ * @return whether or not the invite was accepted by the manager (rejected when disabled)
+ */
@MainThread
- void onIncomingVideoShareInvite(long sessionId, @NonNull String number);
+ boolean onIncomingVideoShareInvite(long sessionId, @NonNull String number);
/**
* Starts a video share session with the given remote number.
@@ -303,4 +316,9 @@ public interface EnrichedCallManager {
*/
@MainThread
void endVideoShareSession(long sessionId);
+
+ /** Interface for filtering sessions (compatible with Predicate from Java 8) */
+ interface Filter {
+ boolean test(Session session);
+ }
}