@Test public void testStartBluetoothMacAddressGattServer() throws Exception { String rqId = "rqId"; Field fieldGattManager = mBluetoothMacAddressResolutionHelper.getClass() .getDeclaredField("mBluetoothGattManager"); fieldGattManager.setAccessible(true); fieldGattManager.set(mBluetoothMacAddressResolutionHelper, mMockBluetoothGattManager); when(mMockBluetoothGattManager.getIsBluetoothMacAddressRequestServerStarted()) .thenReturn(true); mBluetoothMacAddressResolutionHelper.startBluetoothMacAddressGattServer(rqId); verify(mMockBluetoothGattManager, never()).startBluetoothMacAddressRequestServer(anyString()); when(mMockBluetoothGattManager.getIsBluetoothMacAddressRequestServerStarted()) .thenReturn(false); mBluetoothMacAddressResolutionHelper.startBluetoothMacAddressGattServer(rqId); verify(mMockBluetoothGattManager, times(1)).startBluetoothMacAddressRequestServer(rqId); }
public void startBluetoothMacAddressGattServer(String requestId) { Log.v(TAG, "startBluetoothMacAddressGattServer: Request ID: " + requestId); if (!mBluetoothGattManager.getIsBluetoothMacAddressRequestServerStarted()) { mBluetoothGattManager.startBluetoothMacAddressRequestServer(requestId); } else { Log.d(TAG, "startBluetoothMacAddressGattServer: Already started"); } }
BluetoothMacAddressResolutionHelper implements BluetoothDeviceDiscoverer.BluetoothDeviceDiscovererListener,
                   BluetoothGattManager.BluetoothGattManagerListener { public void startBluetoothMacAddressGattServer(String requestId) { Log.v(TAG, "startBluetoothMacAddressGattServer: Request ID: " + requestId); if (!mBluetoothGattManager.getIsBluetoothMacAddressRequestServerStarted()) { mBluetoothGattManager.startBluetoothMacAddressRequestServer(requestId); } else { Log.d(TAG, "startBluetoothMacAddressGattServer: Already started"); } } }
BluetoothMacAddressResolutionHelper implements BluetoothDeviceDiscoverer.BluetoothDeviceDiscovererListener,
                   BluetoothGattManager.BluetoothGattManagerListener { public void startBluetoothMacAddressGattServer(String requestId) { Log.v(TAG, "startBluetoothMacAddressGattServer: Request ID: " + requestId); if (!mBluetoothGattManager.getIsBluetoothMacAddressRequestServerStarted()) { mBluetoothGattManager.startBluetoothMacAddressRequestServer(requestId); } else { Log.d(TAG, "startBluetoothMacAddressGattServer: Already started"); } } BluetoothMacAddressResolutionHelper(
            Context context, BluetoothAdapter bluetoothAdapter, DiscoveryManager discoveryManager,
            UUID bleServiceUuid, UUID provideBluetoothMacAddressRequestUuid);  BluetoothMacAddressResolutionHelper(
            Context context, BluetoothAdapter bluetoothAdapter, DiscoveryManager discoveryManager,
            UUID bleServiceUuid, UUID provideBluetoothMacAddressRequestUuid, SharedPreferences preferences); }
BluetoothMacAddressResolutionHelper implements BluetoothDeviceDiscoverer.BluetoothDeviceDiscovererListener,
                   BluetoothGattManager.BluetoothGattManagerListener { public void startBluetoothMacAddressGattServer(String requestId) { Log.v(TAG, "startBluetoothMacAddressGattServer: Request ID: " + requestId); if (!mBluetoothGattManager.getIsBluetoothMacAddressRequestServerStarted()) { mBluetoothGattManager.startBluetoothMacAddressRequestServer(requestId); } else { Log.d(TAG, "startBluetoothMacAddressGattServer: Already started"); } } BluetoothMacAddressResolutionHelper(
            Context context, BluetoothAdapter bluetoothAdapter, DiscoveryManager discoveryManager,
            UUID bleServiceUuid, UUID provideBluetoothMacAddressRequestUuid);  BluetoothMacAddressResolutionHelper(
            Context context, BluetoothAdapter bluetoothAdapter, DiscoveryManager discoveryManager,
            UUID bleServiceUuid, UUID provideBluetoothMacAddressRequestUuid, SharedPreferences preferences); UUID getProvideBluetoothMacAddressRequestUuid(); String getCurrentProvideBluetoothMacAddressRequestId(); boolean getIsProvideBluetoothMacAddressModeStarted(); boolean getIsBluetoothMacAddressGattServerStarted(); boolean getIsReceiveBluetoothMacAddressModeStarted(); synchronized void stopAllBluetoothMacAddressResolutionOperations(); synchronized boolean startProvideBluetoothMacAddressMode(String requestId); synchronized void stopProvideBluetoothMacAddressMode(); void provideBluetoothMacAddressToDevice(BluetoothDevice bluetoothDevice); synchronized void startReceiveBluetoothMacAddressMode(String requestId); synchronized void stopReceiveBluetoothMacAddressMode(); void startBluetoothMacAddressGattServer(String requestId); synchronized boolean startBluetoothDeviceDiscovery(); synchronized boolean stopBluetoothDeviceDiscovery(); @Override void onBluetoothDeviceDiscovered(BluetoothDevice bluetoothDevice); @Override void onBluetoothGattClientOperationCountInQueueChanged(int operationCountInQueue); @Override void onProvideBluetoothMacAddressResult(String requestId, boolean wasCompleted); @Override void onBluetoothMacAddressResolved(String bluetoothMacAddress); }
BluetoothMacAddressResolutionHelper implements BluetoothDeviceDiscoverer.BluetoothDeviceDiscovererListener,
                   BluetoothGattManager.BluetoothGattManagerListener { public void startBluetoothMacAddressGattServer(String requestId) { Log.v(TAG, "startBluetoothMacAddressGattServer: Request ID: " + requestId); if (!mBluetoothGattManager.getIsBluetoothMacAddressRequestServerStarted()) { mBluetoothGattManager.startBluetoothMacAddressRequestServer(requestId); } else { Log.d(TAG, "startBluetoothMacAddressGattServer: Already started"); } } BluetoothMacAddressResolutionHelper(
            Context context, BluetoothAdapter bluetoothAdapter, DiscoveryManager discoveryManager,
            UUID bleServiceUuid, UUID provideBluetoothMacAddressRequestUuid);  BluetoothMacAddressResolutionHelper(
            Context context, BluetoothAdapter bluetoothAdapter, DiscoveryManager discoveryManager,
            UUID bleServiceUuid, UUID provideBluetoothMacAddressRequestUuid, SharedPreferences preferences); UUID getProvideBluetoothMacAddressRequestUuid(); String getCurrentProvideBluetoothMacAddressRequestId(); boolean getIsProvideBluetoothMacAddressModeStarted(); boolean getIsBluetoothMacAddressGattServerStarted(); boolean getIsReceiveBluetoothMacAddressModeStarted(); synchronized void stopAllBluetoothMacAddressResolutionOperations(); synchronized boolean startProvideBluetoothMacAddressMode(String requestId); synchronized void stopProvideBluetoothMacAddressMode(); void provideBluetoothMacAddressToDevice(BluetoothDevice bluetoothDevice); synchronized void startReceiveBluetoothMacAddressMode(String requestId); synchronized void stopReceiveBluetoothMacAddressMode(); void startBluetoothMacAddressGattServer(String requestId); synchronized boolean startBluetoothDeviceDiscovery(); synchronized boolean stopBluetoothDeviceDiscovery(); @Override void onBluetoothDeviceDiscovered(BluetoothDevice bluetoothDevice); @Override void onBluetoothGattClientOperationCountInQueueChanged(int operationCountInQueue); @Override void onProvideBluetoothMacAddressResult(String requestId, boolean wasCompleted); @Override void onBluetoothMacAddressResolved(String bluetoothMacAddress);  }