@Test public void testStopAllBluetoothMacAddressResolutionOperations() throws Exception { Field field = mBluetoothMacAddressResolutionHelper.getClass() .getDeclaredField("mReceiveBluetoothMacAddressTimeoutTimer"); field.setAccessible(true); field.set(mBluetoothMacAddressResolutionHelper, mMockCountDownTimer); Field fieldGattManager = mBluetoothMacAddressResolutionHelper.getClass() .getDeclaredField("mBluetoothGattManager"); fieldGattManager.setAccessible(true); fieldGattManager.set(mBluetoothMacAddressResolutionHelper, mMockBluetoothGattManager); Field fieldBTDiscoverer = mBluetoothMacAddressResolutionHelper.getClass() .getDeclaredField("mBluetoothDeviceDiscoverer"); fieldBTDiscoverer.setAccessible(true); fieldBTDiscoverer.set(mBluetoothMacAddressResolutionHelper, mMockBluetoothDeviceDiscoverer); mBluetoothMacAddressResolutionHelper.stopAllBluetoothMacAddressResolutionOperations(); verify(mMockCountDownTimer, times(1)).cancel(); assertThat("Is set to null if receive bt mac address properly stopped", field.get(mBluetoothMacAddressResolutionHelper), is(nullValue())); verify(mMockBluetoothGattManager, times(1)).stopBluetoothMacAddressRequestServer(); verify(mMockBluetoothGattManager, times(1)).clearBluetoothGattClientOperationQueue(); verify(mMockDiscoveryManager, times(1)). onProvideBluetoothMacAddressModeStartedChanged(false); verify(mMockBluetoothDeviceDiscoverer, atLeastOnce()).stop(); }
public synchronized void stopAllBluetoothMacAddressResolutionOperations() { stopProvideBluetoothMacAddressMode(); stopReceiveBluetoothMacAddressMode(); mBluetoothGattManager.stopBluetoothMacAddressRequestServer(); }
BluetoothMacAddressResolutionHelper implements BluetoothDeviceDiscoverer.BluetoothDeviceDiscovererListener,
                   BluetoothGattManager.BluetoothGattManagerListener { public synchronized void stopAllBluetoothMacAddressResolutionOperations() { stopProvideBluetoothMacAddressMode(); stopReceiveBluetoothMacAddressMode(); mBluetoothGattManager.stopBluetoothMacAddressRequestServer(); } }
BluetoothMacAddressResolutionHelper implements BluetoothDeviceDiscoverer.BluetoothDeviceDiscovererListener,
                   BluetoothGattManager.BluetoothGattManagerListener { public synchronized void stopAllBluetoothMacAddressResolutionOperations() { stopProvideBluetoothMacAddressMode(); stopReceiveBluetoothMacAddressMode(); mBluetoothGattManager.stopBluetoothMacAddressRequestServer(); } 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 synchronized void stopAllBluetoothMacAddressResolutionOperations() { stopProvideBluetoothMacAddressMode(); stopReceiveBluetoothMacAddressMode(); mBluetoothGattManager.stopBluetoothMacAddressRequestServer(); } 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 synchronized void stopAllBluetoothMacAddressResolutionOperations() { stopProvideBluetoothMacAddressMode(); stopReceiveBluetoothMacAddressMode(); mBluetoothGattManager.stopBluetoothMacAddressRequestServer(); } 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);  }