From 2ca4318cc1ee57dda907ba2069bd61d162b1baef Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Thu, 31 Aug 2017 06:57:16 -0700 Subject: Update Dialer source to latest internal Google revision. Previously, Android's Dialer app was developed in an internal Google source control system and only exported to public during AOSP drops. The Dialer team is now switching to a public development model similar to the telephony team. This CL represents all internal Google changes that were committed to Dialer between the public O release and today's tip of tree on internal master. This CL squashes those changes into a single commit. In subsequent changes, changes will be exported on a per-commit basis. Test: make, flash install, run Merged-In: I45270eaa8ce732d71a1bd84b08c7fa0e99af3160 Change-Id: I529aaeb88535b9533c0ae4ef4e6c1222d4e0f1c8 PiperOrigin-RevId: 167068436 --- .../dialer/enrichedcall/EnrichedCallManager.java | 76 +++++++++++++++------- 1 file changed, 51 insertions(+), 25 deletions(-) (limited to 'java/com/android/dialer/enrichedcall/EnrichedCallManager.java') diff --git a/java/com/android/dialer/enrichedcall/EnrichedCallManager.java b/java/com/android/dialer/enrichedcall/EnrichedCallManager.java index 0d3ed9e43..0606a00e5 100644 --- a/java/com/android/dialer/enrichedcall/EnrichedCallManager.java +++ b/java/com/android/dialer/enrichedcall/EnrichedCallManager.java @@ -16,7 +16,6 @@ package com.android.dialer.enrichedcall; -import android.support.annotation.IntDef; import android.support.annotation.MainThread; import android.support.annotation.NonNull; import android.support.annotation.Nullable; @@ -24,9 +23,8 @@ import com.android.dialer.calldetails.CallDetailsEntries; import com.android.dialer.calldetails.CallDetailsEntries.CallDetailsEntry; import com.android.dialer.enrichedcall.historyquery.proto.HistoryResult; import com.android.dialer.enrichedcall.videoshare.VideoShareListener; +import com.android.dialer.enrichedcall.videoshare.VideoShareSession; import com.android.dialer.multimedia.MultimediaData; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; import java.util.List; import java.util.Map; @@ -81,27 +79,6 @@ public interface EnrichedCallManager { @MainThread void clearCachedData(); - /** Possible states for call composer sessions. */ - @Retention(RetentionPolicy.SOURCE) - @IntDef({ - STATE_NONE, - STATE_STARTING, - STATE_STARTED, - STATE_START_FAILED, - STATE_MESSAGE_SENT, - STATE_MESSAGE_FAILED, - STATE_CLOSED, - }) - @interface State {} - - int STATE_NONE = 0; - int STATE_STARTING = STATE_NONE + 1; - int STATE_STARTED = STATE_STARTING + 1; - int STATE_START_FAILED = STATE_STARTED + 1; - int STATE_MESSAGE_SENT = STATE_START_FAILED + 1; - int STATE_MESSAGE_FAILED = STATE_MESSAGE_SENT + 1; - int STATE_CLOSED = STATE_MESSAGE_FAILED + 1; - /** * Starts a call composer session with the given remote number. * @@ -119,7 +96,7 @@ public interface EnrichedCallManager { * @param sessionId the id for the session. See {@link #startCallComposerSession(String)} * @param data the {@link MultimediaData} * @throws IllegalArgumentException if there's no open session with the given number - * @throws IllegalStateException if the session isn't in the {@link #STATE_STARTED} state + * @throws IllegalStateException if the session isn't in the {@link Session#STATE_STARTED} state */ @MainThread void sendCallComposerData(long sessionId, @NonNull MultimediaData data); @@ -185,12 +162,49 @@ public interface EnrichedCallManager { @Nullable Session getSession(long sessionId); + /** + * Returns a list containing viewable string representations of all existing sessions. + * + *

Intended for debug display purposes only. + */ + @MainThread + @NonNull + List getAllSessionsForDisplay(); + @NonNull Filter createIncomingCallComposerFilter(); @NonNull Filter createOutgoingCallComposerFilter(); + /** Receives updates when the state of an historical data changes. */ + interface HistoricalDataChangedListener { + + /** + * Callback fired when historical data changes. Listeners should call {@link + * #getAllHistoricalData(String, CallDetailsEntries)} to retrieve the new data. + */ + void onHistoricalDataChanged(); + } + + /** + * Registers the given {@link HistoricalDataChangedListener}. + * + *

As a result of this method, the listener will receive updates when the state of any enriched + * call historical data changes. + */ + @MainThread + void registerHistoricalDataChangedListener(@NonNull HistoricalDataChangedListener listener); + + /** + * Unregisters the given {@link HistoricalDataChangedListener}. + * + *

As a result of this method, the listener will not receive updates when the state of enriched + * call historical data changes. + */ + @MainThread + void unregisterHistoricalDataChangedListener(@NonNull HistoricalDataChangedListener listener); + /** * Starts an asynchronous process to get all historical data for the given number and set of * {@link CallDetailsEntries}. @@ -212,6 +226,10 @@ public interface EnrichedCallManager { Map> getAllHistoricalData( @NonNull String number, @NonNull CallDetailsEntries entries); + /** Returns true if any enriched calls have been made or received. */ + @MainThread + boolean hasStoredData(); + /** * Unregisters the given {@link StateChangedListener}. * @@ -309,6 +327,14 @@ public interface EnrichedCallManager { @MainThread long getVideoShareInviteSessionId(@NonNull String number); + /** + * Returns the {@link VideoShareSession} for the given sessionId, or {@code null} if no session + * exists. + */ + @MainThread + @Nullable + VideoShareSession getVideoShareSession(long sessionId); + /** * Ends the given video share session. * -- cgit v1.2.3