Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da266f20 authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Formalize ConnectionService#onCreateXComplete hidden APIs.

These were added a long time ago for the Telephony stack so that it could
know when Telecom has finished adding a new connection or conference.
The original design of ConnectionService#onCreateConnectionComplete and
ConnectionService#onCreateConferenceComplete assumes that the developer
returns their instance of Connection or Conference, respectively, from
those APIs and the platform then adds those to Telecom.

The original API design there has a small timing issue in that if you
want to signal on the Connection/Conference, you need to wait until it has
been added to Telecom first.  In practice this is not often a problem,
well, until it is.  We've had a few 3p VOIP apps running into similar
issues so making these public gives them the same benefit we've seen
in the Telephony stack.

Test: Added new CTS test coverage for these APIs.
Fixes: 317391843
Change-Id: I46b00e468873bc7f880f6a4bd2416adfa0a4c161
parent a0961704
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -42366,6 +42366,8 @@ package android.telecom {
    method public void onConference(android.telecom.Connection, android.telecom.Connection);
    method public void onConnectionServiceFocusGained();
    method public void onConnectionServiceFocusLost();
    method @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public void onCreateConferenceComplete(@NonNull android.telecom.Conference);
    method @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public void onCreateConnectionComplete(@NonNull android.telecom.Connection);
    method @Nullable public android.telecom.Conference onCreateIncomingConference(@NonNull android.telecom.PhoneAccountHandle, @NonNull android.telecom.ConnectionRequest);
    method public void onCreateIncomingConferenceFailed(@Nullable android.telecom.PhoneAccountHandle, @Nullable android.telecom.ConnectionRequest);
    method public android.telecom.Connection onCreateIncomingConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
+10 −8
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.telecom;

import android.annotation.CallbackExecutor;
import android.annotation.FlaggedApi;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
@@ -43,6 +44,7 @@ import com.android.internal.os.SomeArgs;
import com.android.internal.telecom.IConnectionService;
import com.android.internal.telecom.IConnectionServiceAdapter;
import com.android.internal.telecom.RemoteServiceCallback;
import com.android.server.telecom.flags.Flags;

import java.util.ArrayList;
import java.util.Collection;
@@ -3235,27 +3237,27 @@ public abstract class ConnectionService extends Service {
    }

    /**
     * Called after the {@link Connection} returned by
     * Called by Telecom after the {@link Connection} returned by
     * {@link #onCreateIncomingConnection(PhoneAccountHandle, ConnectionRequest)}
     * or {@link #onCreateOutgoingConnection(PhoneAccountHandle, ConnectionRequest)} has been
     * added to the {@link ConnectionService} and sent to Telecom.
     *
     * @param connection the {@link Connection}.
     * @hide
     * @param connection the {@link Connection} which was added to Telecom.
     */
    public void onCreateConnectionComplete(Connection connection) {
    @FlaggedApi(Flags.FLAG_TELECOM_RESOLVE_HIDDEN_DEPENDENCIES)
    public void onCreateConnectionComplete(@NonNull Connection connection) {
    }

    /**
     * Called after the {@link Conference} returned by
     * Called by Telecom after the {@link Conference} returned by
     * {@link #onCreateIncomingConference(PhoneAccountHandle, ConnectionRequest)}
     * or {@link #onCreateOutgoingConference(PhoneAccountHandle, ConnectionRequest)} has been
     * added to the {@link ConnectionService} and sent to Telecom.
     *
     * @param conference the {@link Conference}.
     * @hide
     * @param conference the {@link Conference} which was added to Telecom.
     */
    public void onCreateConferenceComplete(Conference conference) {
    @FlaggedApi(Flags.FLAG_TELECOM_RESOLVE_HIDDEN_DEPENDENCIES)
    public void onCreateConferenceComplete(@NonNull Conference conference) {
    }