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

Commit 23e1bd2a authored by Sal Savage's avatar Sal Savage Committed by Automerger Merge Worker
Browse files

Migrate LE Audio related profile enable/disable to sysprops am: e6603c92 am: 17360258

parents 38d758e9 17360258
Loading
Loading
Loading
Loading
+86 −70
Original line number Original line Diff line number Diff line
@@ -157,6 +157,92 @@
            </intent-filter>
            </intent-filter>
        </activity>
        </activity>


        <!--  Basic Audio Profile (BAP) Profile Service  -->
        <service
            android:process="@string/process"
            android:name="com.android.bluetooth.le_audio.LeAudioService"
            android:enabled="true"
            android:exported="true">
            <intent-filter>
                <action android:name="android.bluetooth.IBluetoothLeAudio" />
            </intent-filter>
        </service>

        <!-- Basic Audio Profile (BAP) Broadcast Assistant Profle Service -->
        <service
            android:process="@string/process"
            android:name = "com.android.bluetooth.bass_client.BassClientService"
            android:enabled="true"
            android:exported = "true">
            <intent-filter>
                <action android:name="android.bluetooth.IBluetoothLeBroadcastAssistant" />
            </intent-filter>
        </service>

        <!-- Battery Service (BAS) Client Profle Service -->
        <service
            android:process="@string/process"
            android:name="com.android.bluetooth.bas.BatteryService"
            android:enabled="true"
            android:exported = "true">
            <intent-filter>
                <action android:name="android.bluetooth.IBluetoothBattery" />
            </intent-filter>
        </service>

        <!--  Coordinated Set Identification Profile (CSIP) set coordinator Profile Service  -->
        <service
            android:process="@string/process"
            android:name="com.android.bluetooth.csip.CsipSetCoordinatorService"
            android:enabled="true"
            android:exported="true">
            <intent-filter>
                <action android:name="android.bluetooth.IBluetoothCsipSetCoordinator" />
            </intent-filter>
        </service>

        <!--  Hearing Aid Profile (HAP) client Profile Service  -->
        <service android:process="@string/process"
             android:name="com.android.bluetooth.hap.HapClientService"
             android:enabled="true"
             android:exported="true">
            <intent-filter>
                <action android:name="android.bluetooth.IBluetoothHapClient"/>
            </intent-filter>
        </service>

        <!--  Media Control Profile (MCP) server Profile Service  -->
        <service android:process="@string/process"
             android:name="com.android.bluetooth.mcp.McpService"
             android:enabled="true"
             android:exported="true">
            <intent-filter>
                <action android:name="android.bluetooth.IBluetoothMcpServiceManager" />
            </intent-filter>
        </service>

        <!--  Telephony Bearer Service (TBS) server Profile Service  -->
        <service
            android:process="@string/process"
            android:name="com.android.bluetooth.tbs.TbsService"
            android:enabled="true"
            android:exported="true">
            <intent-filter>
                <action android:name="android.bluetooth.IBluetoothLeCallControl" />
            </intent-filter>
        </service>

        <!--  Volume Control Profile (VCP) server Profile Service  -->
        <service
            android:process="@string/process"
            android:name="com.android.bluetooth.vc.VolumeControlService"
            android:enabled="true"
            android:exported="true">
            <intent-filter>
                <action android:name="android.bluetooth.IBluetoothVolumeControl" />
            </intent-filter>
        </service>

        <provider android:name=".opp.BluetoothOppProvider"
        <provider android:name=".opp.BluetoothOppProvider"
             android:authorities="com.android.bluetooth.opp"
             android:authorities="com.android.bluetooth.opp"
             android:exported="true"
             android:exported="true"
@@ -379,14 +465,6 @@
                <action android:name="android.bluetooth.IBluetoothHidDevice"/>
                <action android:name="android.bluetooth.IBluetoothHidDevice"/>
            </intent-filter>
            </intent-filter>
        </service>
        </service>
        <service android:process="@string/process"
             android:name=".mcp.McpService"
             android:exported="true"
             android:enabled="@bool/profile_supported_mcp_server">
            <intent-filter>
                <action android:name="android.bluetooth.IBluetoothMcpServiceManager" />
            </intent-filter>
        </service>
        <service
        <service
             android:process="@string/process"
             android:process="@string/process"
             android:name=".pan.PanService"
             android:name=".pan.PanService"
@@ -429,59 +507,6 @@
                <action android:name="android.bluetooth.IBluetoothHearingAid"/>
                <action android:name="android.bluetooth.IBluetoothHearingAid"/>
            </intent-filter>
            </intent-filter>
        </service>
        </service>
        <service android:process="@string/process"
             android:name=".hap.HapClientService"
             android:enabled="@bool/profile_supported_hap_client"
             android:exported="true">
            <intent-filter>
                <action android:name="android.bluetooth.IBluetoothHapClient"/>
            </intent-filter>
        </service>
        <service
            android:process="@string/process"
            android:name=".vc.VolumeControlService"
            android:exported="true"
            android:enabled="@bool/profile_supported_vc">
            <intent-filter>
                <action android:name="android.bluetooth.IBluetoothVolumeControl" />
            </intent-filter>
        </service>
        <service
            android:process="@string/process"
            android:name = ".le_audio.LeAudioService"
            android:enabled="@bool/profile_supported_le_audio"
            android:exported = "true">
            <intent-filter>
                <action android:name="android.bluetooth.IBluetoothLeAudio" />
            </intent-filter>
        </service>
        <service
            android:process="@string/process"
            android:name = ".csip.CsipSetCoordinatorService"
            android:enabled="@bool/profile_supported_csip_set_coordinator"
            android:exported = "true">
            <intent-filter>
                <action android:name="android.bluetooth.IBluetoothCsipSetCoordinator" />
            </intent-filter>
        </service>
        <service
            android:process="@string/process"
            android:name = ".tbs.TbsService"
            android:enabled="@bool/profile_supported_le_call_control"
            android:exported = "true">
            <intent-filter>
                <action android:name="android.bluetooth.IBluetoothLeCallControl" />
            </intent-filter>
        </service>
        <service
            android:process="@string/process"
            android:name = ".bass_client.BassClientService"
            android:enabled="@bool/profile_supported_bass_client"
            android:exported = "true">
            <intent-filter>
                <action android:name="android.bluetooth.IBluetoothLeBroadcastAssistant" />
            </intent-filter>
        </service>
        <!-- Authenticator for PBAP account. -->
        <!-- Authenticator for PBAP account. -->
        <service android:process="@string/process"
        <service android:process="@string/process"
             android:name=".pbapclient.AuthenticationService"
             android:name=".pbapclient.AuthenticationService"
@@ -505,14 +530,5 @@
              <action android:name="android.telecom.InCallService"/>
              <action android:name="android.telecom.InCallService"/>
            </intent-filter>
            </intent-filter>
         </service>
         </service>
        <service
            android:process="@string/process"
            android:name=".bas.BatteryService"
            android:enabled="@bool/profile_supported_battery"
            android:exported = "true">
            <intent-filter>
                <action android:name="android.bluetooth.IBluetoothBattery" />
            </intent-filter>
        </service>
    </application>
    </application>
</manifest>
</manifest>
+0 −9
Original line number Original line Diff line number Diff line
@@ -28,15 +28,6 @@
    <bool name="profile_supported_pbapclient">false</bool>
    <bool name="profile_supported_pbapclient">false</bool>
    <bool name="profile_supported_mapmce">false</bool>
    <bool name="profile_supported_mapmce">false</bool>
    <bool name="profile_supported_hid_device">true</bool>
    <bool name="profile_supported_hid_device">true</bool>
    <bool name="profile_supported_le_audio">true</bool>
    <bool name="profile_supported_le_audio_broadcast">false</bool>
    <bool name="profile_supported_vc">true</bool>
    <bool name="profile_supported_mcp_server">true</bool>
    <bool name="profile_supported_csip_set_coordinator">true</bool>
    <bool name="profile_supported_le_call_control">true</bool>
    <bool name="profile_supported_hap_client">true</bool>
    <bool name="profile_supported_bass_client">true</bool>
    <bool name="profile_supported_battery">true</bool>


    <!-- If true, we will require location to be enabled on the device to
    <!-- If true, we will require location to be enabled on the device to
         fire Bluetooth LE scan result callbacks in addition to having one
         fire Bluetooth LE scan result callbacks in addition to having one
+5 −0
Original line number Original line Diff line number Diff line
@@ -32,6 +32,7 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.content.IntentFilter;
import android.os.HandlerThread;
import android.os.HandlerThread;
import android.os.ParcelUuid;
import android.os.ParcelUuid;
import android.sysprop.BluetoothProperties;
import android.util.Log;
import android.util.Log;


import com.android.bluetooth.Utils;
import com.android.bluetooth.Utils;
@@ -66,6 +67,10 @@ public class BatteryService extends ProfileService {


    private BroadcastReceiver mBondStateChangedReceiver;
    private BroadcastReceiver mBondStateChangedReceiver;


    public static boolean isEnabled() {
        return BluetoothProperties.isProfileBasClientEnabled().orElse(false);
    }

    @Override
    @Override
    protected IProfileServiceBinder initBinder() {
    protected IProfileServiceBinder initBinder() {
        return new BluetoothBatteryBinder(this);
        return new BluetoothBatteryBinder(this);
+5 −0
Original line number Original line Diff line number Diff line
@@ -39,6 +39,7 @@ import android.os.Message;
import android.os.ParcelUuid;
import android.os.ParcelUuid;
import android.os.RemoteCallbackList;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
import android.os.RemoteException;
import android.sysprop.BluetoothProperties;
import android.util.Log;
import android.util.Log;


import com.android.bluetooth.Utils;
import com.android.bluetooth.Utils;
@@ -86,6 +87,10 @@ public class BassClientService extends ProfileService {
    private ScanCallback mSearchScanCallback;
    private ScanCallback mSearchScanCallback;
    private Callbacks mCallbacks;
    private Callbacks mCallbacks;


    public static boolean isEnabled() {
        return BluetoothProperties.isProfileBapBroadcastAssistEnabled().orElse(false);
    }

    void updatePeriodicAdvertisementResultMap(
    void updatePeriodicAdvertisementResultMap(
            BluetoothDevice device,
            BluetoothDevice device,
            int addressType,
            int addressType,
+1 −1
Original line number Original line Diff line number Diff line
@@ -4607,7 +4607,7 @@ public class AdapterService extends Service {
     * @return true, if the LE audio broadcast source is supported
     * @return true, if the LE audio broadcast source is supported
     */
     */
    public boolean isLeAudioBroadcastSourceSupported() {
    public boolean isLeAudioBroadcastSourceSupported() {
        return  getResources().getBoolean(R.bool.profile_supported_le_audio_broadcast)
        return  BluetoothProperties.isProfileBapBroadcastSourceEnabled().orElse(false)
                && mAdapterProperties.isLePeriodicAdvertisingSupported()
                && mAdapterProperties.isLePeriodicAdvertisingSupported()
                && mAdapterProperties.isLeExtendedAdvertisingSupported()
                && mAdapterProperties.isLeExtendedAdvertisingSupported()
                && mAdapterProperties.isLeIsochronousBroadcasterSupported();
                && mAdapterProperties.isLeIsochronousBroadcasterSupported();
Loading