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

Commit 373aa276 authored by Sanket Agarwal's avatar Sanket Agarwal
Browse files

Move MediaBrowserService to Bluetooth Process

MediaBrowserService exports A2DP streaming features to the rest of stack
using the MediaBrowser API. Currently it was being stareted by
BOOT_COMPLETE which made it start very late. Also that meant that some
of the broadcasts for the connection events is lost. Now it is started
by the A2DP state machine so that we do not miss any state changes.

Bug: 27744764
Change-Id: I193b4adfea09cbd90e41f1a217383b6aa234ef2b
parent bd9ada97
Loading
Loading
Loading
Loading
+16 −4
Original line number Diff line number Diff line
@@ -297,12 +297,21 @@
        </service>
        <service
            android:process="@string/process"
            android:name = ".a2dp.A2dpSinkService"
            android:name = ".a2dpsink.A2dpSinkService"
            android:enabled="@bool/profile_supported_a2dp_sink">
            <intent-filter>
                <action android:name="android.bluetooth.IBluetoothA2dpSink" />
            </intent-filter>
        </service>
        <service
            android:process="@string/process"
            android:name=".a2dpsink.mbs.A2dpMediaBrowserService"
            android:exported="true"
            android:enabled="@bool/profile_supported_a2dp_sink">
            <intent-filter>
                <action android:name="android.media.browse.MediaBrowserService" />
            </intent-filter>
        </service>
        <service
            android:process="@string/process"
            android:name = ".avrcp.AvrcpControllerService"
@@ -343,7 +352,9 @@
                <action android:name="android.bluetooth.IBluetoothHeadsetClient" />
            </intent-filter>
        </service>
        <service android:name=".hfpclient.connserv.HfpClientConnectionService"
        <service
            android:process="@string/process"
            android:name=".hfpclient.connserv.HfpClientConnectionService"
            android:permission="android.permission.BIND_CONNECTION_SERVICE"
            android:enabled="@bool/profile_supported_hfpclient">
            <intent-filter>
@@ -361,6 +372,7 @@
        </service>
        <!-- Authenticator for PBAP account. -->
        <service
            android:process="@string/process"
            android:name=".AuthenticationService"
            android:exported="true"
            android:enabled="@bool/profile_supported_pbapclient">
+2 −0
Original line number Diff line number Diff line
@@ -243,4 +243,6 @@
    <string name="bluetooth_map_settings_app_icon">Application Icon</string>
    <string name="bluetooth_map_settings_title">Bluetooth Message Sharing Settings</string>
    <string name="bluetooth_map_settings_no_account_slots_left">Cannot select account. 0 slots left</string>
    <string name="bluetooth_connected">Bluetooth audio connected</string>
    <string name="bluetooth_disconnected">Bluetooth audio disconnected"</string>
</resources>
+0 −19
Original line number Diff line number Diff line
# Copyright 2015 Google Inc. All Rights Reserved.

LOCAL_PATH := $(call my-dir)

# Build the application.
include $(CLEAR_VARS)

LOCAL_PACKAGE_NAME := A2dpMediaBrowserService
LOCAL_MODULE_TAGS := optional
LOCAL_CERTIFICATE := platform

LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_RESOURCE_DIR = $(LOCAL_PATH)/res

LOCAL_PROGUARD_ENABLED := disabled

include $(BUILD_PACKAGE)

include $(call all-makefiles-under,$(LOCAL_PATH))
+0 −51
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2015, The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.google.android.a2dpsink.mbs" >

    <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="21" />

    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_ROUTING" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

    <application
        android:allowBackup="false"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <meta-data android:name="com.google.android.gms.car.application"
            android:resource="@xml/automotive_app_desc" />

        <meta-data android:name="com.google.android.gms.car.notification.SmallIcon"
            android:resource="@drawable/ic_notification" />

        <service android:name=".A2dpMediaBrowserService" android:exported="true">
            <intent-filter>
                <action android:name="android.media.browse.MediaBrowserService" />
            </intent-filter>
        </service>

        <receiver android:name=".BootCompleteReceiver">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>
        </receiver>

    </application>
</manifest>
−4.05 KiB
Loading image diff...
Loading