Loading android/app/AndroidManifest.xml +13 −10 Original line number Diff line number Diff line Loading @@ -91,7 +91,18 @@ android:directBootAware="true" android:defaultToDeviceProtectedStorage="true" android:memtagMode="async"> <provider android:name="com.android.bluetooth.opp.BluetoothOppProvider" <!-- Advanced Audio Distribution Profile (A2DP) source Profile Service --> <service android:process="@string/process" android:name="com.android.bluetooth.a2dp.A2dpService" android:enabled="true" android:exported="true"> <intent-filter> <action android:name="android.bluetooth.IBluetoothA2dp"/> </intent-filter> </service> <provider android:name=".opp.BluetoothOppProvider" android:authorities="com.android.bluetooth.opp" android:exported="true" android:process="@string/process"> Loading Loading @@ -300,15 +311,7 @@ </intent-filter> </service> <service android:process="@string/process" android:name="com.android.bluetooth.a2dp.A2dpService" android:enabled="@bool/profile_supported_a2dp" android:exported="true"> <intent-filter> <action android:name="android.bluetooth.IBluetoothA2dp"/> </intent-filter> </service> <service android:process="@string/process" android:name="com.android.bluetooth.a2dpsink.A2dpSinkService" android:name=".a2dpsink.A2dpSinkService" android:enabled="@bool/profile_supported_a2dp_sink" android:exported="true"> <intent-filter> Loading android/app/res/values/config.xml +0 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,6 @@ limitations under the License. --> <resources> <bool name="profile_supported_a2dp">true</bool> <bool name="profile_supported_a2dp_sink">false</bool> <bool name="profile_supported_hs_hfp">true</bool> <bool name="profile_supported_hfpclient">false</bool> Loading android/app/src/com/android/bluetooth/a2dp/A2dpService.java +5 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ import android.media.AudioManager; import android.media.BluetoothProfileConnectionInfo; import android.os.Build; import android.os.HandlerThread; import android.sysprop.BluetoothProperties; import android.util.Log; import com.android.bluetooth.BluetoothMetricsProto; Loading Loading @@ -103,6 +104,10 @@ public class A2dpService extends ProfileService { private BroadcastReceiver mBondStateChangedReceiver; private BroadcastReceiver mConnectionStateChangedReceiver; public static boolean isEnabled() { return BluetoothProperties.isProfileA2dpSourceEnabled().orElse(false); } @Override protected IProfileServiceBinder initBinder() { return new BluetoothA2dpBinder(this); Loading android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpServiceTest.java +2 −3 Original line number Diff line number Diff line Loading @@ -83,8 +83,7 @@ public class A2dpServiceTest { @Before public void setUp() throws Exception { mTargetContext = InstrumentationRegistry.getTargetContext(); Assume.assumeTrue("Ignore test when A2dpService is not enabled", mTargetContext.getResources().getBoolean(R.bool.profile_supported_a2dp)); Assume.assumeTrue("Ignore test when A2dpService is not enabled", A2dpService.isEnabled()); // Set up mocks and test assets MockitoAnnotations.initMocks(this); Loading Loading @@ -124,7 +123,7 @@ public class A2dpServiceTest { @After public void tearDown() throws Exception { if (!mTargetContext.getResources().getBoolean(R.bool.profile_supported_a2dp)) { if (!A2dpService.isEnabled()) { return; } stopService(); Loading android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpStateMachineTest.java +2 −3 Original line number Diff line number Diff line Loading @@ -70,8 +70,7 @@ public class A2dpStateMachineTest { @Before public void setUp() throws Exception { mTargetContext = InstrumentationRegistry.getTargetContext(); Assume.assumeTrue("Ignore test when A2dpService is not enabled", mTargetContext.getResources().getBoolean(R.bool.profile_supported_a2dp)); Assume.assumeTrue("Ignore test when A2dpService is not enabled", A2dpService.isEnabled()); // Set up mocks and test assets MockitoAnnotations.initMocks(this); TestUtils.setAdapterService(mAdapterService); Loading Loading @@ -117,7 +116,7 @@ public class A2dpStateMachineTest { @After public void tearDown() throws Exception { if (!mTargetContext.getResources().getBoolean(R.bool.profile_supported_a2dp)) { if (!A2dpService.isEnabled()) { return; } mA2dpStateMachine.doQuit(); Loading Loading
android/app/AndroidManifest.xml +13 −10 Original line number Diff line number Diff line Loading @@ -91,7 +91,18 @@ android:directBootAware="true" android:defaultToDeviceProtectedStorage="true" android:memtagMode="async"> <provider android:name="com.android.bluetooth.opp.BluetoothOppProvider" <!-- Advanced Audio Distribution Profile (A2DP) source Profile Service --> <service android:process="@string/process" android:name="com.android.bluetooth.a2dp.A2dpService" android:enabled="true" android:exported="true"> <intent-filter> <action android:name="android.bluetooth.IBluetoothA2dp"/> </intent-filter> </service> <provider android:name=".opp.BluetoothOppProvider" android:authorities="com.android.bluetooth.opp" android:exported="true" android:process="@string/process"> Loading Loading @@ -300,15 +311,7 @@ </intent-filter> </service> <service android:process="@string/process" android:name="com.android.bluetooth.a2dp.A2dpService" android:enabled="@bool/profile_supported_a2dp" android:exported="true"> <intent-filter> <action android:name="android.bluetooth.IBluetoothA2dp"/> </intent-filter> </service> <service android:process="@string/process" android:name="com.android.bluetooth.a2dpsink.A2dpSinkService" android:name=".a2dpsink.A2dpSinkService" android:enabled="@bool/profile_supported_a2dp_sink" android:exported="true"> <intent-filter> Loading
android/app/res/values/config.xml +0 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,6 @@ limitations under the License. --> <resources> <bool name="profile_supported_a2dp">true</bool> <bool name="profile_supported_a2dp_sink">false</bool> <bool name="profile_supported_hs_hfp">true</bool> <bool name="profile_supported_hfpclient">false</bool> Loading
android/app/src/com/android/bluetooth/a2dp/A2dpService.java +5 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ import android.media.AudioManager; import android.media.BluetoothProfileConnectionInfo; import android.os.Build; import android.os.HandlerThread; import android.sysprop.BluetoothProperties; import android.util.Log; import com.android.bluetooth.BluetoothMetricsProto; Loading Loading @@ -103,6 +104,10 @@ public class A2dpService extends ProfileService { private BroadcastReceiver mBondStateChangedReceiver; private BroadcastReceiver mConnectionStateChangedReceiver; public static boolean isEnabled() { return BluetoothProperties.isProfileA2dpSourceEnabled().orElse(false); } @Override protected IProfileServiceBinder initBinder() { return new BluetoothA2dpBinder(this); Loading
android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpServiceTest.java +2 −3 Original line number Diff line number Diff line Loading @@ -83,8 +83,7 @@ public class A2dpServiceTest { @Before public void setUp() throws Exception { mTargetContext = InstrumentationRegistry.getTargetContext(); Assume.assumeTrue("Ignore test when A2dpService is not enabled", mTargetContext.getResources().getBoolean(R.bool.profile_supported_a2dp)); Assume.assumeTrue("Ignore test when A2dpService is not enabled", A2dpService.isEnabled()); // Set up mocks and test assets MockitoAnnotations.initMocks(this); Loading Loading @@ -124,7 +123,7 @@ public class A2dpServiceTest { @After public void tearDown() throws Exception { if (!mTargetContext.getResources().getBoolean(R.bool.profile_supported_a2dp)) { if (!A2dpService.isEnabled()) { return; } stopService(); Loading
android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpStateMachineTest.java +2 −3 Original line number Diff line number Diff line Loading @@ -70,8 +70,7 @@ public class A2dpStateMachineTest { @Before public void setUp() throws Exception { mTargetContext = InstrumentationRegistry.getTargetContext(); Assume.assumeTrue("Ignore test when A2dpService is not enabled", mTargetContext.getResources().getBoolean(R.bool.profile_supported_a2dp)); Assume.assumeTrue("Ignore test when A2dpService is not enabled", A2dpService.isEnabled()); // Set up mocks and test assets MockitoAnnotations.initMocks(this); TestUtils.setAdapterService(mAdapterService); Loading Loading @@ -117,7 +116,7 @@ public class A2dpStateMachineTest { @After public void tearDown() throws Exception { if (!mTargetContext.getResources().getBoolean(R.bool.profile_supported_a2dp)) { if (!A2dpService.isEnabled()) { return; } mA2dpStateMachine.doQuit(); Loading