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

Commit 14c64908 authored by Sal Savage's avatar Sal Savage Committed by Automerger Merge Worker
Browse files

Migrate MAP client enable/disable to sysprops am: cbb3c5da am: 4bf6275e

parents 468eceba 4bf6275e
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -296,6 +296,16 @@
             android:exported="false">
        </provider>

        <!--  Message Access Profile (MAP) client Profile Service  -->
        <service android:process="@string/process"
             android:name="com.android.bluetooth.mapclient.MapClientService"
             android:enabled="true"
             android:exported="true">
            <intent-filter>
                <action android:name="android.bluetooth.IBluetoothMapClient"/>
            </intent-filter>
        </service>

        <!--  Media Control Profile (MCP) server Profile Service  -->
        <service android:process="@string/process"
             android:name="com.android.bluetooth.mcp.McpService"
@@ -479,14 +489,6 @@
                <action android:name="android.bluetooth.IBluetoothPbap"/>
            </intent-filter>
        </service>
        <service android:process="@string/process"
             android:name=".mapclient.MapClientService"
             android:enabled="@bool/profile_supported_mapmce"
             android:exported="true">
            <intent-filter>
                <action android:name="android.bluetooth.IBluetoothMapClient"/>
            </intent-filter>
        </service>
        <service android:process="@string/process"
             android:name=".sap.SapService"
             android:enabled="@bool/profile_supported_sap"
+0 −1
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@
    <bool name="pbap_use_profile_for_owner_vcard">true</bool>
    <bool name="profile_supported_sap">false</bool>
    <bool name="profile_supported_pbapclient">false</bool>
    <bool name="profile_supported_mapmce">false</bool>

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

import com.android.bluetooth.Utils;
@@ -65,6 +66,10 @@ public class MapClientService extends ProfileService {
    private static MapClientService sMapClientService;
    private MapBroadcastReceiver mMapReceiver;

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

    public static synchronized MapClientService getMapClientService() {
        if (sMapClientService == null) {
            Log.w(TAG, "getMapClientService(): service is null");
+2 −2
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ public class MapClientStateMachineTest {
    public void setUp() throws Exception {
        mTargetContext = InstrumentationRegistry.getTargetContext();
        Assume.assumeTrue("Ignore test when MapClientService is not enabled",
                mTargetContext.getResources().getBoolean(R.bool.profile_supported_mapmce));
                MapClientService.isEnabled());
        MockitoAnnotations.initMocks(this);
        mMockContentProvider = new MockSmsContentProvider();
        mMockContentResolver = new MockContentResolver();
@@ -142,7 +142,7 @@ public class MapClientStateMachineTest {

    @After
    public void tearDown() throws Exception {
        if (!mTargetContext.getResources().getBoolean(R.bool.profile_supported_mapmce)) {
        if (!MapClientService.isEnabled()) {
            return;
        }

+2 −2
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ public class MapClientTest {
    public void setUp() throws Exception {
        mTargetContext = InstrumentationRegistry.getTargetContext();
        Assume.assumeTrue("Ignore test when MapClientService is not enabled",
                mTargetContext.getResources().getBoolean(R.bool.profile_supported_mapmce));
                MapClientService.isEnabled());
        MockitoAnnotations.initMocks(this);
        TestUtils.setAdapterService(mAdapterService);
        when(mAdapterService.getDatabase()).thenReturn(mDatabaseManager);
@@ -82,7 +82,7 @@ public class MapClientTest {

    @After
    public void tearDown() throws Exception {
        if (!mTargetContext.getResources().getBoolean(R.bool.profile_supported_mapmce)) {
        if (!MapClientService.isEnabled()) {
            return;
        }
        TestUtils.stopService(mServiceRule, MapClientService.class);