diff options
author | 2023-12-21 21:23:31 +0000 | |
---|---|---|
committer | 2024-02-02 22:36:49 +0000 | |
commit | da266f200c734b423755d39113bb97349dd4d66f (patch) | |
tree | 647854e84b4e4a04b2497391d4db33ab84da320b | |
parent | a09617041de099d25708913b91d9e28d32e17cbc (diff) |
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
-rw-r--r-- | core/api/current.txt | 2 | ||||
-rwxr-xr-x | telecomm/java/android/telecom/ConnectionService.java | 18 |
2 files changed, 12 insertions, 8 deletions
diff --git a/core/api/current.txt b/core/api/current.txt index 04f907a59535..1047d56059e7 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -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); diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java index 536e458159d1..01448c3bcd9e 100755 --- a/telecomm/java/android/telecom/ConnectionService.java +++ b/telecomm/java/android/telecom/ConnectionService.java @@ -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) { } |