@Test public void testGetRemoteDevice() throws Exception { String myAddress = "address"; when(mMockBluetoothAdapter.getRemoteDevice(myAddress)).thenReturn(mMockBluetoothDevice); assertThat("should properly return the remote device", mBluetoothManager.getRemoteDevice(myAddress), is(mMockBluetoothDevice)); }
public BluetoothDevice getRemoteDevice(String address) { BluetoothDevice bluetoothDevice = null; if (mBluetoothAdapter != null) { try { bluetoothDevice = mBluetoothAdapter.getRemoteDevice(address); } catch (IllegalArgumentException e) { Log.e(TAG, "getRemoteDevice: Failed to get the remote device: " + e.getMessage(), e); } } else { Log.e(TAG, "getRemoteDevice: No Bluetooth adapter instance"); } return bluetoothDevice; }
BluetoothManager { public BluetoothDevice getRemoteDevice(String address) { BluetoothDevice bluetoothDevice = null; if (mBluetoothAdapter != null) { try { bluetoothDevice = mBluetoothAdapter.getRemoteDevice(address); } catch (IllegalArgumentException e) { Log.e(TAG, "getRemoteDevice: Failed to get the remote device: " + e.getMessage(), e); } } else { Log.e(TAG, "getRemoteDevice: No Bluetooth adapter instance"); } return bluetoothDevice; } }
BluetoothManager { public BluetoothDevice getRemoteDevice(String address) { BluetoothDevice bluetoothDevice = null; if (mBluetoothAdapter != null) { try { bluetoothDevice = mBluetoothAdapter.getRemoteDevice(address); } catch (IllegalArgumentException e) { Log.e(TAG, "getRemoteDevice: Failed to get the remote device: " + e.getMessage(), e); } } else { Log.e(TAG, "getRemoteDevice: No Bluetooth adapter instance"); } return bluetoothDevice; } private  BluetoothManager(Context context); private  BluetoothManager(Context context, BluetoothAdapter bluetoothAdapter,
                             SharedPreferences sharedPreferences); }
BluetoothManager { public BluetoothDevice getRemoteDevice(String address) { BluetoothDevice bluetoothDevice = null; if (mBluetoothAdapter != null) { try { bluetoothDevice = mBluetoothAdapter.getRemoteDevice(address); } catch (IllegalArgumentException e) { Log.e(TAG, "getRemoteDevice: Failed to get the remote device: " + e.getMessage(), e); } } else { Log.e(TAG, "getRemoteDevice: No Bluetooth adapter instance"); } return bluetoothDevice; } private  BluetoothManager(Context context); private  BluetoothManager(Context context, BluetoothAdapter bluetoothAdapter,
                             SharedPreferences sharedPreferences); static BluetoothManager getInstance(Context context); static BluetoothManager getInstance(Context context, BluetoothAdapter bluetoothAdapter,
                                               SharedPreferences sharedPreferences); synchronized boolean bind(BluetoothManagerListener listener); synchronized void release(BluetoothManagerListener listener); boolean isBluetoothSupported(); boolean isBleSupported(); @TargetApi(21) FeatureSupportedStatus isBleMultipleAdvertisementSupported(); @TargetApi(21) FeatureSupportedStatus isBleOffloadedScanBatchingSupported(); @TargetApi(21) FeatureSupportedStatus isBleOffloadedFilteringSupported(); boolean isBluetoothEnabled(); boolean setBluetoothEnabled(boolean enable); BluetoothAdapter getBluetoothAdapter(); String getBluetoothMacAddress(); String getBluetoothName(); BluetoothDevice getRemoteDevice(String address); }
BluetoothManager { public BluetoothDevice getRemoteDevice(String address) { BluetoothDevice bluetoothDevice = null; if (mBluetoothAdapter != null) { try { bluetoothDevice = mBluetoothAdapter.getRemoteDevice(address); } catch (IllegalArgumentException e) { Log.e(TAG, "getRemoteDevice: Failed to get the remote device: " + e.getMessage(), e); } } else { Log.e(TAG, "getRemoteDevice: No Bluetooth adapter instance"); } return bluetoothDevice; } private  BluetoothManager(Context context); private  BluetoothManager(Context context, BluetoothAdapter bluetoothAdapter,
                             SharedPreferences sharedPreferences); static BluetoothManager getInstance(Context context); static BluetoothManager getInstance(Context context, BluetoothAdapter bluetoothAdapter,
                                               SharedPreferences sharedPreferences); synchronized boolean bind(BluetoothManagerListener listener); synchronized void release(BluetoothManagerListener listener); boolean isBluetoothSupported(); boolean isBleSupported(); @TargetApi(21) FeatureSupportedStatus isBleMultipleAdvertisementSupported(); @TargetApi(21) FeatureSupportedStatus isBleOffloadedScanBatchingSupported(); @TargetApi(21) FeatureSupportedStatus isBleOffloadedFilteringSupported(); boolean isBluetoothEnabled(); boolean setBluetoothEnabled(boolean enable); BluetoothAdapter getBluetoothAdapter(); String getBluetoothMacAddress(); String getBluetoothName(); BluetoothDevice getRemoteDevice(String address);  }