Loading android/app/AndroidManifest.xml +12 −10 Original line number Diff line number Diff line Loading @@ -199,6 +199,17 @@ </intent-filter> </service> <!-- Generic Attribute (GATT) Profile Service --> <service android:process="@string/process" android:name="com.android.bluetooth.gatt.GattService" android:enabled="true" android:exported="true" android:permission="android.permission.ACCESS_BLUETOOTH_SHARE"> <intent-filter> <action android:name="android.bluetooth.IBluetoothGatt"/> </intent-filter> </service> <!-- Hearing Aid Profile (HAP) client Profile Service --> <service android:process="@string/process" android:name="com.android.bluetooth.hap.HapClientService" Loading Loading @@ -433,16 +444,7 @@ </intent-filter> </service> <service android:process="@string/process" android:name="com.android.bluetooth.gatt.GattService" android:enabled="@bool/profile_supported_gatt" android:exported="true" android:permission="android.permission.ACCESS_BLUETOOTH_SHARE"> <intent-filter> <action android:name="android.bluetooth.IBluetoothGatt"/> </intent-filter> </service> <service android:process="@string/process" android:name="com.android.bluetooth.hfp.HeadsetService" android:name=".hfp.HeadsetService" android:enabled="@bool/profile_supported_hs_hfp" android:exported="true"> <intent-filter> Loading android/app/res/values/config.xml +0 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ <bool name="profile_supported_opp">true</bool> <bool name="profile_supported_pan">true</bool> <bool name="profile_supported_pbap">true</bool> <bool name="profile_supported_gatt">true</bool> <bool name="pbap_include_photos_in_vcard">true</bool> <bool name="pbap_use_profile_for_owner_vcard">true</bool> <bool name="profile_supported_map">true</bool> Loading android/app/src/com/android/bluetooth/gatt/GattService.java +5 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ import android.os.UserHandle; import android.os.WorkSource; import android.provider.DeviceConfig; import android.provider.Settings; import android.sysprop.BluetoothProperties; import android.text.format.DateUtils; import android.util.Log; Loading Loading @@ -268,6 +269,10 @@ public class GattService extends ProfileService { private Handler mTestModeHandler; private final Object mTestModeLock = new Object(); public static boolean isEnabled() { return BluetoothProperties.isProfileGattEnabled().orElse(false); } /** */ private final Predicate<ScanResult> mLocationDenylistPredicate = (scanResult) -> { Loading android/app/tests/unit/src/com/android/bluetooth/gatt/GattServiceTest.java +2 −3 Original line number Diff line number Diff line Loading @@ -40,8 +40,7 @@ public class GattServiceTest { @Before public void setUp() throws Exception { mTargetContext = InstrumentationRegistry.getTargetContext(); Assume.assumeTrue("Ignore test when GattService is not enabled", mTargetContext.getResources().getBoolean(R.bool.profile_supported_gatt)); Assume.assumeTrue("Ignore test when GattService is not enabled", GattService.isEnabled()); MockitoAnnotations.initMocks(this); TestUtils.setAdapterService(mAdapterService); doReturn(true).when(mAdapterService).isStartedProfile(anyString()); Loading @@ -52,7 +51,7 @@ public class GattServiceTest { @After public void tearDown() throws Exception { if (!mTargetContext.getResources().getBoolean(R.bool.profile_supported_gatt)) { if (!GattService.isEnabled()) { return; } doReturn(false).when(mAdapterService).isStartedProfile(anyString()); Loading Loading
android/app/AndroidManifest.xml +12 −10 Original line number Diff line number Diff line Loading @@ -199,6 +199,17 @@ </intent-filter> </service> <!-- Generic Attribute (GATT) Profile Service --> <service android:process="@string/process" android:name="com.android.bluetooth.gatt.GattService" android:enabled="true" android:exported="true" android:permission="android.permission.ACCESS_BLUETOOTH_SHARE"> <intent-filter> <action android:name="android.bluetooth.IBluetoothGatt"/> </intent-filter> </service> <!-- Hearing Aid Profile (HAP) client Profile Service --> <service android:process="@string/process" android:name="com.android.bluetooth.hap.HapClientService" Loading Loading @@ -433,16 +444,7 @@ </intent-filter> </service> <service android:process="@string/process" android:name="com.android.bluetooth.gatt.GattService" android:enabled="@bool/profile_supported_gatt" android:exported="true" android:permission="android.permission.ACCESS_BLUETOOTH_SHARE"> <intent-filter> <action android:name="android.bluetooth.IBluetoothGatt"/> </intent-filter> </service> <service android:process="@string/process" android:name="com.android.bluetooth.hfp.HeadsetService" android:name=".hfp.HeadsetService" android:enabled="@bool/profile_supported_hs_hfp" android:exported="true"> <intent-filter> Loading
android/app/res/values/config.xml +0 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ <bool name="profile_supported_opp">true</bool> <bool name="profile_supported_pan">true</bool> <bool name="profile_supported_pbap">true</bool> <bool name="profile_supported_gatt">true</bool> <bool name="pbap_include_photos_in_vcard">true</bool> <bool name="pbap_use_profile_for_owner_vcard">true</bool> <bool name="profile_supported_map">true</bool> Loading
android/app/src/com/android/bluetooth/gatt/GattService.java +5 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ import android.os.UserHandle; import android.os.WorkSource; import android.provider.DeviceConfig; import android.provider.Settings; import android.sysprop.BluetoothProperties; import android.text.format.DateUtils; import android.util.Log; Loading Loading @@ -268,6 +269,10 @@ public class GattService extends ProfileService { private Handler mTestModeHandler; private final Object mTestModeLock = new Object(); public static boolean isEnabled() { return BluetoothProperties.isProfileGattEnabled().orElse(false); } /** */ private final Predicate<ScanResult> mLocationDenylistPredicate = (scanResult) -> { Loading
android/app/tests/unit/src/com/android/bluetooth/gatt/GattServiceTest.java +2 −3 Original line number Diff line number Diff line Loading @@ -40,8 +40,7 @@ public class GattServiceTest { @Before public void setUp() throws Exception { mTargetContext = InstrumentationRegistry.getTargetContext(); Assume.assumeTrue("Ignore test when GattService is not enabled", mTargetContext.getResources().getBoolean(R.bool.profile_supported_gatt)); Assume.assumeTrue("Ignore test when GattService is not enabled", GattService.isEnabled()); MockitoAnnotations.initMocks(this); TestUtils.setAdapterService(mAdapterService); doReturn(true).when(mAdapterService).isStartedProfile(anyString()); Loading @@ -52,7 +51,7 @@ public class GattServiceTest { @After public void tearDown() throws Exception { if (!mTargetContext.getResources().getBoolean(R.bool.profile_supported_gatt)) { if (!GattService.isEnabled()) { return; } doReturn(false).when(mAdapterService).isStartedProfile(anyString()); Loading