@Test public void testIsBleSupported() throws Exception { when(mMockContext.getPackageManager()).thenReturn(mMockPackageManager); when(mMockPackageManager.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) .thenReturn(true); assertThat("should be true as the device supports BLE", mBluetoothManager.isBleSupported(), is(true)); when(mMockPackageManager.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) .thenReturn(false); assertThat("should be false as the device doesn't support BLE", mBluetoothManager.isBleSupported(), is(false)); }
public boolean isBleSupported() { return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE); }
BluetoothManager { public boolean isBleSupported() { return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE); } }
BluetoothManager { public boolean isBleSupported() { return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE); } private  BluetoothManager(Context context); private  BluetoothManager(Context context, BluetoothAdapter bluetoothAdapter,
                             SharedPreferences sharedPreferences); }
BluetoothManager { public boolean isBleSupported() { return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE); } 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 boolean isBleSupported() { return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE); } 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);  }