Loading android/app/AndroidManifest.xml +20 −19 Original line number Diff line number Diff line Loading @@ -230,6 +230,25 @@ </intent-filter> </service> <!-- Hands-Free HF/Client Profile Service and owned Service --> <service android:process="@string/process" android:name="com.android.bluetooth.hfpclient.HeadsetClientService" android:enabled="true" android:exported="true"> <intent-filter> <action android:name="android.bluetooth.IBluetoothHeadsetClient"/> </intent-filter> </service> <service android:process="@string/process" android:name="com.android.bluetooth.hfpclient.HfpClientConnectionService" android:permission="android.permission.BIND_CONNECTION_SERVICE" android:enabled="true" android:exported="true"> <intent-filter> <action android:name="android.telecom.ConnectionService"/> </intent-filter> </service> <!-- Human Interface Device (HID) host Profile Service --> <service android:process="@string/process" android:name="com.android.bluetooth.hid.HidHostService" Loading Loading @@ -491,25 +510,7 @@ </intent-filter> </service> <service android:process="@string/process" android:name="com.android.bluetooth.hfpclient.HeadsetClientService" android:enabled="@bool/profile_supported_hfpclient" android:exported="true"> <intent-filter> <action android:name="android.bluetooth.IBluetoothHeadsetClient"/> </intent-filter> </service> <service android:process="@string/process" android:name="com.android.bluetooth.hfpclient.HfpClientConnectionService" android:permission="android.permission.BIND_CONNECTION_SERVICE" android:enabled="@bool/hfp_client_connection_service_enabled" android:exported="true"> <intent-filter> <!-- Mechanism for Telecom stack to connect --> <action android:name="android.telecom.ConnectionService"/> </intent-filter> </service> <service android:process="@string/process" android:name="com.android.bluetooth.pbapclient.PbapClientService" android:name=".pbapclient.PbapClientService" android:enabled="@bool/profile_supported_pbapclient" android:exported="true"> <intent-filter> Loading android/app/res/values/config.xml +0 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,6 @@ --> <resources> <bool name="profile_supported_hs_hfp">true</bool> <bool name="profile_supported_hfpclient">false</bool> <bool name="profile_supported_hfp_incallservice">true</bool> <bool name="profile_supported_opp">true</bool> <bool name="profile_supported_pan">true</bool> Loading android/app/src/com/android/bluetooth/hfpclient/HeadsetClientService.java +5 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.os.BatteryManager; import android.os.Bundle; import android.os.HandlerThread; import android.os.Message; import android.sysprop.BluetoothProperties; import android.util.Log; import com.android.bluetooth.Utils; Loading Loading @@ -81,6 +82,10 @@ public class HeadsetClientService extends ProfileService { public static final String HFP_CLIENT_STOP_TAG = "hfp_client_stop_tag"; public static boolean isEnabled() { return BluetoothProperties.isProfileHfpHfEnabled().orElse(false); } @Override public IProfileServiceBinder initBinder() { return new BluetoothHeadsetClientBinder(this); Loading android/app/tests/unit/src/com/android/bluetooth/hfpclient/HeadsetClientServiceTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ public class HeadsetClientServiceTest { public void setUp() throws Exception { mTargetContext = InstrumentationRegistry.getTargetContext(); Assume.assumeTrue("Ignore test when HeadsetClientService is not enabled", mTargetContext.getResources().getBoolean(R.bool.profile_supported_hfpclient)); HeadsetClientService.isEnabled()); MockitoAnnotations.initMocks(this); TestUtils.setAdapterService(mAdapterService); doReturn(mDatabaseManager).when(mAdapterService).getDatabase(); Loading @@ -86,7 +86,7 @@ public class HeadsetClientServiceTest { @After public void tearDown() throws Exception { if (!mTargetContext.getResources().getBoolean(R.bool.profile_supported_hfpclient)) { if (!HeadsetClientService.isEnabled()) { return; } TestUtils.stopService(mServiceRule, HeadsetClientService.class); Loading android/app/tests/unit/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachineTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -72,7 +72,7 @@ public class HeadsetClientStateMachineTest { public void setUp() { mTargetContext = InstrumentationRegistry.getTargetContext(); Assume.assumeTrue("Ignore test when HeadsetClientService is not enabled", mTargetContext.getResources().getBoolean(R.bool.profile_supported_hfpclient)); HeadsetClientService.isEnabled()); // Setup mocks and test assets MockitoAnnotations.initMocks(this); // Set a valid volume Loading Loading @@ -105,7 +105,7 @@ public class HeadsetClientStateMachineTest { @After public void tearDown() { if (!mTargetContext.getResources().getBoolean(R.bool.profile_supported_hfpclient)) { if (!HeadsetClientService.isEnabled()) { return; } TestUtils.waitForLooperToFinishScheduledTask(mHandlerThread.getLooper()); Loading Loading
android/app/AndroidManifest.xml +20 −19 Original line number Diff line number Diff line Loading @@ -230,6 +230,25 @@ </intent-filter> </service> <!-- Hands-Free HF/Client Profile Service and owned Service --> <service android:process="@string/process" android:name="com.android.bluetooth.hfpclient.HeadsetClientService" android:enabled="true" android:exported="true"> <intent-filter> <action android:name="android.bluetooth.IBluetoothHeadsetClient"/> </intent-filter> </service> <service android:process="@string/process" android:name="com.android.bluetooth.hfpclient.HfpClientConnectionService" android:permission="android.permission.BIND_CONNECTION_SERVICE" android:enabled="true" android:exported="true"> <intent-filter> <action android:name="android.telecom.ConnectionService"/> </intent-filter> </service> <!-- Human Interface Device (HID) host Profile Service --> <service android:process="@string/process" android:name="com.android.bluetooth.hid.HidHostService" Loading Loading @@ -491,25 +510,7 @@ </intent-filter> </service> <service android:process="@string/process" android:name="com.android.bluetooth.hfpclient.HeadsetClientService" android:enabled="@bool/profile_supported_hfpclient" android:exported="true"> <intent-filter> <action android:name="android.bluetooth.IBluetoothHeadsetClient"/> </intent-filter> </service> <service android:process="@string/process" android:name="com.android.bluetooth.hfpclient.HfpClientConnectionService" android:permission="android.permission.BIND_CONNECTION_SERVICE" android:enabled="@bool/hfp_client_connection_service_enabled" android:exported="true"> <intent-filter> <!-- Mechanism for Telecom stack to connect --> <action android:name="android.telecom.ConnectionService"/> </intent-filter> </service> <service android:process="@string/process" android:name="com.android.bluetooth.pbapclient.PbapClientService" android:name=".pbapclient.PbapClientService" android:enabled="@bool/profile_supported_pbapclient" android:exported="true"> <intent-filter> Loading
android/app/res/values/config.xml +0 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,6 @@ --> <resources> <bool name="profile_supported_hs_hfp">true</bool> <bool name="profile_supported_hfpclient">false</bool> <bool name="profile_supported_hfp_incallservice">true</bool> <bool name="profile_supported_opp">true</bool> <bool name="profile_supported_pan">true</bool> Loading
android/app/src/com/android/bluetooth/hfpclient/HeadsetClientService.java +5 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.os.BatteryManager; import android.os.Bundle; import android.os.HandlerThread; import android.os.Message; import android.sysprop.BluetoothProperties; import android.util.Log; import com.android.bluetooth.Utils; Loading Loading @@ -81,6 +82,10 @@ public class HeadsetClientService extends ProfileService { public static final String HFP_CLIENT_STOP_TAG = "hfp_client_stop_tag"; public static boolean isEnabled() { return BluetoothProperties.isProfileHfpHfEnabled().orElse(false); } @Override public IProfileServiceBinder initBinder() { return new BluetoothHeadsetClientBinder(this); Loading
android/app/tests/unit/src/com/android/bluetooth/hfpclient/HeadsetClientServiceTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ public class HeadsetClientServiceTest { public void setUp() throws Exception { mTargetContext = InstrumentationRegistry.getTargetContext(); Assume.assumeTrue("Ignore test when HeadsetClientService is not enabled", mTargetContext.getResources().getBoolean(R.bool.profile_supported_hfpclient)); HeadsetClientService.isEnabled()); MockitoAnnotations.initMocks(this); TestUtils.setAdapterService(mAdapterService); doReturn(mDatabaseManager).when(mAdapterService).getDatabase(); Loading @@ -86,7 +86,7 @@ public class HeadsetClientServiceTest { @After public void tearDown() throws Exception { if (!mTargetContext.getResources().getBoolean(R.bool.profile_supported_hfpclient)) { if (!HeadsetClientService.isEnabled()) { return; } TestUtils.stopService(mServiceRule, HeadsetClientService.class); Loading
android/app/tests/unit/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachineTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -72,7 +72,7 @@ public class HeadsetClientStateMachineTest { public void setUp() { mTargetContext = InstrumentationRegistry.getTargetContext(); Assume.assumeTrue("Ignore test when HeadsetClientService is not enabled", mTargetContext.getResources().getBoolean(R.bool.profile_supported_hfpclient)); HeadsetClientService.isEnabled()); // Setup mocks and test assets MockitoAnnotations.initMocks(this); // Set a valid volume Loading Loading @@ -105,7 +105,7 @@ public class HeadsetClientStateMachineTest { @After public void tearDown() { if (!mTargetContext.getResources().getBoolean(R.bool.profile_supported_hfpclient)) { if (!HeadsetClientService.isEnabled()) { return; } TestUtils.waitForLooperToFinishScheduledTask(mHandlerThread.getLooper()); Loading