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

Commit db95af25 authored by Sanket Agarwal's avatar Sanket Agarwal Committed by Gerrit Code Review
Browse files

Merge "MAP MCE"

parents fe33cb11 b68b83c0
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -265,6 +265,14 @@
                  android:grantUriPermissions="true"
                  android:grantUriPermissions="true"
                  android:exported="false">
                  android:exported="false">
        </provider>
        </provider>
        <service
            android:process="@string/process"
            android:name=".mapclient.MapClientService"
            android:enabled="@bool/profile_supported_mapmce" >
            <intent-filter>
                <action android:name="android.bluetooth.IBluetoothMapClient" />
            </intent-filter>
        </service>
        <service
        <service
            android:process="@string/process"
            android:process="@string/process"
            android:name=".sap.SapService"
            android:name=".sap.SapService"
+1 −0
Original line number Original line Diff line number Diff line
@@ -29,6 +29,7 @@
    <bool name="profile_supported_avrcp_controller">false</bool>
    <bool name="profile_supported_avrcp_controller">false</bool>
    <bool name="profile_supported_sap">false</bool>
    <bool name="profile_supported_sap">false</bool>
    <bool name="profile_supported_pbapclient">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
    <!-- 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
+1 −1
Original line number Original line Diff line number Diff line
@@ -190,7 +190,7 @@ public class ObexServerSockets {
     * Set state to accept new incoming connection. Will cause the next incoming connection to be
     * Set state to accept new incoming connection. Will cause the next incoming connection to be
     * Signaled through {@link IObexConnectionValidator#onConnect()};
     * Signaled through {@link IObexConnectionValidator#onConnect()};
     */
     */
    public void prepareForNewConnect() {
    synchronized public void prepareForNewConnect() {
        if(D) Log.d(TAG, "prepareForNewConnect()");
        if(D) Log.d(TAG, "prepareForNewConnect()");
        mConAccepted = false;
        mConAccepted = false;
    }
    }
+10 −1
Original line number Original line Diff line number Diff line
@@ -65,6 +65,7 @@ import com.android.bluetooth.a2dpsink.A2dpSinkService;
import com.android.bluetooth.hid.HidService;
import com.android.bluetooth.hid.HidService;
import com.android.bluetooth.hfp.HeadsetService;
import com.android.bluetooth.hfp.HeadsetService;
import com.android.bluetooth.hfpclient.HeadsetClientService;
import com.android.bluetooth.hfpclient.HeadsetClientService;
import com.android.bluetooth.mapclient.MapClientService;
import com.android.bluetooth.pan.PanService;
import com.android.bluetooth.pan.PanService;
import com.android.bluetooth.pbapclient.PbapClientService;
import com.android.bluetooth.pbapclient.PbapClientService;
import com.android.bluetooth.sdp.SdpManager;
import com.android.bluetooth.sdp.SdpManager;
@@ -255,7 +256,7 @@ public class AdapterService extends Service {
        HeadsetClientService headsetClientService = HeadsetClientService.getHeadsetClientService();
        HeadsetClientService headsetClientService = HeadsetClientService.getHeadsetClientService();
        PbapClientService pbapClientService = PbapClientService.getPbapClientService();
        PbapClientService pbapClientService = PbapClientService.getPbapClientService();
        PanService panService = PanService.getPanService();
        PanService panService = PanService.getPanService();

        MapClientService mapClientService = MapClientService.getMapClientService();


        // Set profile priorities only for the profiles discovered on the remote device.
        // Set profile priorities only for the profiles discovered on the remote device.
        // This avoids needless auto-connect attempts to profiles non-existent on the remote device
        // This avoids needless auto-connect attempts to profiles non-existent on the remote device
@@ -307,6 +308,14 @@ public class AdapterService extends Service {
                 R.bool.config_bluetooth_pan_enable_autoconnect))) {
                 R.bool.config_bluetooth_pan_enable_autoconnect))) {
            panService.setPriority(device, BluetoothProfile.PRIORITY_ON);
            panService.setPriority(device, BluetoothProfile.PRIORITY_ON);
        }
        }

        if ((mapClientService != null) &&
                ((BluetoothUuid.isUuidPresent(uuids, BluetoothUuid.MAP) ||
                        BluetoothUuid.isUuidPresent(uuids, BluetoothUuid.MAS) ||
                        BluetoothUuid.isUuidPresent(uuids, BluetoothUuid.MNS)) &&
                        (mapClientService.getPriority(device) == BluetoothProfile.PRIORITY_UNDEFINED))) {
            mapClientService.setPriority(device, BluetoothProfile.PRIORITY_ON);
        }
    }
    }


    private void processProfileStateChanged(BluetoothDevice device, int profileId, int newState, int prevState) {
    private void processProfileStateChanged(BluetoothDevice device, int profileId, int newState, int prevState) {
+7 −2
Original line number Original line Diff line number Diff line
@@ -36,6 +36,7 @@ import com.android.bluetooth.hid.HidService;
import com.android.bluetooth.pan.PanService;
import com.android.bluetooth.pan.PanService;
import com.android.bluetooth.gatt.GattService;
import com.android.bluetooth.gatt.GattService;
import com.android.bluetooth.map.BluetoothMapService;
import com.android.bluetooth.map.BluetoothMapService;
import com.android.bluetooth.mapclient.MapClientService;
import com.android.bluetooth.sap.SapService;
import com.android.bluetooth.sap.SapService;
import com.android.bluetooth.pbapclient.PbapClientService;
import com.android.bluetooth.pbapclient.PbapClientService;


@@ -59,7 +60,8 @@ public class Config {
        HeadsetClientService.class,
        HeadsetClientService.class,
        AvrcpControllerService.class,
        AvrcpControllerService.class,
        SapService.class,
        SapService.class,
        PbapClientService.class
        PbapClientService.class,
        MapClientService.class
    };
    };
    /**
    /**
     * Resource flag to indicate whether profile is supported or not.
     * Resource flag to indicate whether profile is supported or not.
@@ -76,7 +78,8 @@ public class Config {
        R.bool.profile_supported_hfpclient,
        R.bool.profile_supported_hfpclient,
        R.bool.profile_supported_avrcp_controller,
        R.bool.profile_supported_avrcp_controller,
        R.bool.profile_supported_sap,
        R.bool.profile_supported_sap,
        R.bool.profile_supported_pbapclient
        R.bool.profile_supported_pbapclient,
        R.bool.profile_supported_mapmce
    };
    };


    private static Class[] SUPPORTED_PROFILES = new Class[0];
    private static Class[] SUPPORTED_PROFILES = new Class[0];
@@ -163,6 +166,8 @@ public class Config {
            profileIndex = BluetoothProfile.SAP;
            profileIndex = BluetoothProfile.SAP;
        } else if (profile == PbapClientService.class) {
        } else if (profile == PbapClientService.class) {
            profileIndex = BluetoothProfile.PBAP_CLIENT;
            profileIndex = BluetoothProfile.PBAP_CLIENT;
        } else if (profile == MapClientService.class) {
            profileIndex = BluetoothProfile.MAP_CLIENT;
        }
        }


        return profileIndex;
        return profileIndex;
Loading