Loading android/app/src/com/android/bluetooth/tbs/TbsGatt.java +8 −5 Original line number Diff line number Diff line Loading @@ -249,9 +249,6 @@ public class TbsGatt { AdapterService.getAdapterService(), "AdapterService shouldn't be null when creating TbsGatt"); mAdapterService.registerBluetoothStateCallback( mContext.getMainExecutor(), mBluetoothStateChangeCallback); mBearerProviderNameCharacteristic = new GattCharacteristic( UUID_BEARER_PROVIDER_NAME, Loading Loading @@ -377,9 +374,15 @@ public class TbsGatt { mEventLogger = new BluetoothEventLogger( LOG_NB_EVENTS, TAG + " instance (CCID= " + ccid + ") event log"); mEventLogger.add("Initializing"); if (!mBluetoothGattServer.addService(gattService)) { mEventLogger.add("Initialization failed"); return false; } return mBluetoothGattServer.addService(gattService); mEventLogger.add("Initialized"); mAdapterService.registerBluetoothStateCallback( mContext.getMainExecutor(), mBluetoothStateChangeCallback); return true; } public void cleanup() { Loading android/app/tests/unit/src/com/android/bluetooth/tbs/TbsGattTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -137,6 +137,7 @@ public class TbsGattTest { mMockTbsGattCallback)); Assert.assertNotNull(mMockGattServer); verify(mAdapterService, times(1)).registerBluetoothStateCallback(any(), any()); verify(mMockGattServer).addService(mGattServiceCaptor.capture()); doReturn(mGattServiceCaptor.getValue()).when(mMockGattServer).getService(any(UUID.class)); Assert.assertNotNull(mMockGattServer); Loading Loading
android/app/src/com/android/bluetooth/tbs/TbsGatt.java +8 −5 Original line number Diff line number Diff line Loading @@ -249,9 +249,6 @@ public class TbsGatt { AdapterService.getAdapterService(), "AdapterService shouldn't be null when creating TbsGatt"); mAdapterService.registerBluetoothStateCallback( mContext.getMainExecutor(), mBluetoothStateChangeCallback); mBearerProviderNameCharacteristic = new GattCharacteristic( UUID_BEARER_PROVIDER_NAME, Loading Loading @@ -377,9 +374,15 @@ public class TbsGatt { mEventLogger = new BluetoothEventLogger( LOG_NB_EVENTS, TAG + " instance (CCID= " + ccid + ") event log"); mEventLogger.add("Initializing"); if (!mBluetoothGattServer.addService(gattService)) { mEventLogger.add("Initialization failed"); return false; } return mBluetoothGattServer.addService(gattService); mEventLogger.add("Initialized"); mAdapterService.registerBluetoothStateCallback( mContext.getMainExecutor(), mBluetoothStateChangeCallback); return true; } public void cleanup() { Loading
android/app/tests/unit/src/com/android/bluetooth/tbs/TbsGattTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -137,6 +137,7 @@ public class TbsGattTest { mMockTbsGattCallback)); Assert.assertNotNull(mMockGattServer); verify(mAdapterService, times(1)).registerBluetoothStateCallback(any(), any()); verify(mMockGattServer).addService(mGattServiceCaptor.capture()); doReturn(mGattServiceCaptor.getValue()).when(mMockGattServer).getService(any(UUID.class)); Assert.assertNotNull(mMockGattServer); Loading