From 9ad3039d7511d1af7ae4a258f9402aeccfd0ee22 Mon Sep 17 00:00:00 2001 From: Pranav Madapurmath Date: Mon, 5 Feb 2024 15:05:16 -0800 Subject: Formalize EXTRA_SKIP_CALL_FILTERING as system API As part of telecom mainline prep, resolve the hidden reference from wear services to EXTRA_SKIP_CALL_FILTERING by promoting it to a system API. Bug: 322518197 Bug: 311773409 Test: m Telecom Test m wear-services-calling-bluetooth & atest WearServicesRoboTests:HfpClientConnectionServiceTest & atest WearServicesRobotTests:HfpClientConnectionTest Change-Id: I47b3f2d6146309157c18246e0e131bab1021c726 --- core/api/system-current.txt | 1 + telecomm/java/android/telecom/PhoneAccount.java | 2 ++ telecomm/java/android/telecom/TelecomManager.java | 20 ++++++++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 66e03db5923b..d5cb27faab0c 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -13738,6 +13738,7 @@ package android.telecom { field public static final int CAPABILITY_EMERGENCY_VIDEO_CALLING = 512; // 0x200 field public static final int CAPABILITY_MULTI_USER = 32; // 0x20 field public static final String EXTRA_PLAY_CALL_RECORDING_TONE = "android.telecom.extra.PLAY_CALL_RECORDING_TONE"; + field @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public static final String EXTRA_SKIP_CALL_FILTERING = "android.telecom.extra.SKIP_CALL_FILTERING"; field public static final String EXTRA_SORT_ORDER = "android.telecom.extra.SORT_ORDER"; } diff --git a/telecomm/java/android/telecom/PhoneAccount.java b/telecomm/java/android/telecom/PhoneAccount.java index b7706a926a3d..ab6f4279b086 100644 --- a/telecomm/java/android/telecom/PhoneAccount.java +++ b/telecomm/java/android/telecom/PhoneAccount.java @@ -190,6 +190,8 @@ public final class PhoneAccount implements Parcelable { * this may be used to skip call filtering when it has already been performed on another device. * @hide */ + @SystemApi + @FlaggedApi(com.android.server.telecom.flags.Flags.FLAG_TELECOM_RESOLVE_HIDDEN_DEPENDENCIES) public static final String EXTRA_SKIP_CALL_FILTERING = "android.telecom.extra.SKIP_CALL_FILTERING"; diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java index e62bd90807d1..6ba5d23d9fe1 100644 --- a/telecomm/java/android/telecom/TelecomManager.java +++ b/telecomm/java/android/telecom/TelecomManager.java @@ -1611,6 +1611,26 @@ public class TelecomManager { * {@link PhoneAccount} when the upper bound limit, 10, has already been reached. * * @param account The complete {@link PhoneAccount}. + * @throws UnsupportedOperationException if the caller cannot modify phone state and the device + * does not have the Telecom feature. + * @throws SecurityException if: + *
    + *
  1. the caller cannot modify phone state and the phone account doesn't belong to the + * calling user.
  2. + *
  3. the caller is registering a self-managed phone and either they are not allowed to + * manage their own calls or if the account is call capable, a connection manager, or a + * sim account.
  4. + *
  5. the caller is registering a sim account without the ability to do so.
  6. + *
  7. the caller is registering a multi-user phone account but isn't a system app.
  8. + *
  9. the account can make SIM-based voice calls but the caller cannot register sim + * accounts or isn't a sim call manager.
  10. + *
  11. the account defines the EXTRA_SKIP_CALL_FILTERING extra but the caller isn't + * able to modify the phone state.
  12. + *
  13. the caller is registering an account for a different user but isn't able to + * interact across users.
  14. + *
  15. if simultaneous calling is available and the phone account package name doesn't + * correspond to the simultaneous calling accounts associated with this phone account.
  16. + *
*/ public void registerPhoneAccount(PhoneAccount account) { ITelecomService service = getTelecomService(); -- cgit v1.2.3-59-g8ed1b