From 45de470c9ec9b45377f46530746cfa03cb472a2a Mon Sep 17 00:00:00 2001 From: Roopa Sattiraju Date: Thu, 27 Jan 2022 21:31:35 -0800 Subject: [PATCH] API changes requires for Bluetooth apk inside the apex to build. Bug: 216731966 Test: Compile and Test Change-Id: Ia9c09fb9ca83141419c9f41ef5c248385fb5a9c0 --- core/api/system-current.txt | 1 + .../android/telecom/ConnectionService.java | 25 ++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 171ee9a0a95b..8cdc01fa1f52 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -11843,6 +11843,7 @@ package android.telecom { public abstract class ConnectionService extends android.app.Service { method public final void addExistingConnection(@NonNull android.telecom.PhoneAccountHandle, @NonNull android.telecom.Connection, @NonNull android.telecom.Conference); + method @Nullable @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telecom.Connection onCreateUnknownConnection(@NonNull android.telecom.PhoneAccountHandle, @NonNull android.telecom.ConnectionRequest); } public abstract class InCallService extends android.app.Service { diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java index c5fc4365df7a..27d423b3bc1e 100755 --- a/telecomm/java/android/telecom/ConnectionService.java +++ b/telecomm/java/android/telecom/ConnectionService.java @@ -18,6 +18,7 @@ package android.telecom; import android.annotation.NonNull; import android.annotation.Nullable; +import android.annotation.RequiresPermission; import android.annotation.SdkConstant; import android.annotation.SystemApi; import android.annotation.TestApi; @@ -3156,15 +3157,27 @@ public abstract class ConnectionService extends Service { } /** - * Create a {@code Connection} for a new unknown call. An unknown call is a call originating - * from the ConnectionService that was neither a user-initiated outgoing call, nor an incoming - * call created using - * {@code TelecomManager#addNewIncomingCall(PhoneAccountHandle, android.os.Bundle)}. + * Calls of this type are created using + * {@link TelecomManager#addNewUnknownCall(PhoneAccountHandle, Bundle)}. Unknown calls + * are used for representing calls which become known to the {@link ConnectionService} + * midway through the call. + * + * For example, a call transferred from one device to answer would surface as an active + * call in Telecom instead of going through a typical Ringing to Active transition, or + * Dialing to Active transition. + * + * A {@link ConnectionService} can return {@code null} (the default behavior) + * if it is not able to handle a request for the requested unknown connection. + * + * {@link TelecomManager#addNewIncomingCall(PhoneAccountHandle, android.os.Bundle)}. * * @hide */ - public Connection onCreateUnknownConnection(PhoneAccountHandle connectionManagerPhoneAccount, - ConnectionRequest request) { + @SystemApi + @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) + public @Nullable Connection onCreateUnknownConnection( + @NonNull PhoneAccountHandle connectionManagerPhoneAccount, + @NonNull ConnectionRequest request) { return null; }