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

Commit ffab9955 authored by Roopa Sattiraju's avatar Roopa Sattiraju
Browse files

Changing BluetoothHeadset APIs from @hide to @SystemApi

For isInbandringing API - it is used in the call journey and would
change the behavior(undeterministic) of the call if not used.

Stop/StartScoUsingVirtualVoiceCall is used in the BluetoothShim layer
specifically for testing and mocking in the Android Apps. Seems
reasonable to keep this as a SystemAPI given that it has no params and
unlikely to be changed.

Bug: 195160939
Tag: #feature
Test: Manual
Change-Id: I02b2e7e5e0be3b462f7c25b655e669e2c7fe47eb
parent c67201c2
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -16,17 +16,16 @@

package android.bluetooth;

import android.Manifest;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SdkConstant;
import android.annotation.SuppressLint;
import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SuppressLint;
import android.annotation.SystemApi;
import android.bluetooth.annotations.RequiresBluetoothConnectPermission;
import android.bluetooth.annotations.RequiresLegacyBluetoothAdminPermission;
import android.bluetooth.annotations.RequiresLegacyBluetoothPermission;
import android.annotation.SystemApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.Attributable;
import android.content.AttributionSource;
@@ -1105,13 +1104,13 @@ public final class BluetoothHeadset implements BluetoothProfile {
     *  - binder is dead or Bluetooth is disabled or other error
     * @hide
     */
    @SystemApi
    @RequiresLegacyBluetoothAdminPermission
    @RequiresBluetoothConnectPermission
    @RequiresPermission(allOf = {
            android.Manifest.permission.BLUETOOTH_CONNECT,
            android.Manifest.permission.MODIFY_PHONE_STATE,
    })
    @UnsupportedAppUsage
    public boolean startScoUsingVirtualVoiceCall() {
        if (DBG) log("startScoUsingVirtualVoiceCall()");
        final IBluetoothHeadset service = mService;
@@ -1140,13 +1139,13 @@ public final class BluetoothHeadset implements BluetoothProfile {
     *  - binder is dead or Bluetooth is disabled or other error
     * @hide
     */
    @SystemApi
    @RequiresLegacyBluetoothAdminPermission
    @RequiresBluetoothConnectPermission
    @RequiresPermission(allOf = {
            android.Manifest.permission.BLUETOOTH_CONNECT,
            android.Manifest.permission.MODIFY_PHONE_STATE,
    })
    @UnsupportedAppUsage
    public boolean stopScoUsingVirtualVoiceCall() {
        if (DBG) log("stopScoUsingVirtualVoiceCall()");
        final IBluetoothHeadset service = mService;
@@ -1343,9 +1342,10 @@ public final class BluetoothHeadset implements BluetoothProfile {
     * @return true if in-band ringing is enabled, false if in-band ringing is disabled
     * @hide
     */
    @SystemApi
    @RequiresLegacyBluetoothPermission
    @RequiresBluetoothConnectPermission
    @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
    @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED)
    public boolean isInbandRingingEnabled() {
        if (DBG) {
            log("isInbandRingingEnabled()");