@Test public void testSetAdvertiseSettings() throws Exception { Field advertiseSettingsField = mBleAdvertiser.getClass().getDeclaredField("mAdvertiseSettings"); advertiseSettingsField.setAccessible(true); mBleAdvertiser.setAdvertiseSettings(mMockAdvertiseSettings); assertThat("The advertise settings is properly set", (AdvertiseSettings) advertiseSettingsField.get(mBleAdvertiser), is(mMockAdvertiseSettings)); }
public void setAdvertiseSettings(AdvertiseSettings advertiseSettings) { Log.d(TAG, "setAdvertiseSettings, " + ThreadUtils.currentThreadToString()); if (advertiseSettings != null) { mAdvertiseSettings = advertiseSettings; Log.i(TAG, "setAdvertiseSettings: Mode: " + mAdvertiseSettings.getMode() + ", Tx power level: " + mAdvertiseSettings.getTxPowerLevel() + ", timeout: " + mAdvertiseSettings.getTimeout() + ", is connectable: " + mAdvertiseSettings.isConnectable()); } else { throw new NullPointerException("The argument (AdvertiseSettings) cannot be null"); } }
BleAdvertiser extends AdvertiseCallback { public void setAdvertiseSettings(AdvertiseSettings advertiseSettings) { Log.d(TAG, "setAdvertiseSettings, " + ThreadUtils.currentThreadToString()); if (advertiseSettings != null) { mAdvertiseSettings = advertiseSettings; Log.i(TAG, "setAdvertiseSettings: Mode: " + mAdvertiseSettings.getMode() + ", Tx power level: " + mAdvertiseSettings.getTxPowerLevel() + ", timeout: " + mAdvertiseSettings.getTimeout() + ", is connectable: " + mAdvertiseSettings.isConnectable()); } else { throw new NullPointerException("The argument (AdvertiseSettings) cannot be null"); } } }
BleAdvertiser extends AdvertiseCallback { public void setAdvertiseSettings(AdvertiseSettings advertiseSettings) { Log.d(TAG, "setAdvertiseSettings, " + ThreadUtils.currentThreadToString()); if (advertiseSettings != null) { mAdvertiseSettings = advertiseSettings; Log.i(TAG, "setAdvertiseSettings: Mode: " + mAdvertiseSettings.getMode() + ", Tx power level: " + mAdvertiseSettings.getTxPowerLevel() + ", timeout: " + mAdvertiseSettings.getTimeout() + ", is connectable: " + mAdvertiseSettings.isConnectable()); } else { throw new NullPointerException("The argument (AdvertiseSettings) cannot be null"); } } BleAdvertiser(Listener listener, BluetoothAdapter bluetoothAdapter);   BleAdvertiser(Listener listener, BluetoothAdapter bluetoothAdapter,
                  AdvertiseSettings.Builder builder, DiscoveryManagerSettings settings); }
BleAdvertiser extends AdvertiseCallback { public void setAdvertiseSettings(AdvertiseSettings advertiseSettings) { Log.d(TAG, "setAdvertiseSettings, " + ThreadUtils.currentThreadToString()); if (advertiseSettings != null) { mAdvertiseSettings = advertiseSettings; Log.i(TAG, "setAdvertiseSettings: Mode: " + mAdvertiseSettings.getMode() + ", Tx power level: " + mAdvertiseSettings.getTxPowerLevel() + ", timeout: " + mAdvertiseSettings.getTimeout() + ", is connectable: " + mAdvertiseSettings.isConnectable()); } else { throw new NullPointerException("The argument (AdvertiseSettings) cannot be null"); } } BleAdvertiser(Listener listener, BluetoothAdapter bluetoothAdapter);   BleAdvertiser(Listener listener, BluetoothAdapter bluetoothAdapter,
                  AdvertiseSettings.Builder builder, DiscoveryManagerSettings settings); void setAdvertiseSettings(AdvertiseSettings advertiseSettings); boolean isStarted(); synchronized boolean start(); synchronized void stop(boolean notifyStateChanged); @Override void onStartFailure(int errorCode); @Override void onStartSuccess(AdvertiseSettings settingsInEffect); }
BleAdvertiser extends AdvertiseCallback { public void setAdvertiseSettings(AdvertiseSettings advertiseSettings) { Log.d(TAG, "setAdvertiseSettings, " + ThreadUtils.currentThreadToString()); if (advertiseSettings != null) { mAdvertiseSettings = advertiseSettings; Log.i(TAG, "setAdvertiseSettings: Mode: " + mAdvertiseSettings.getMode() + ", Tx power level: " + mAdvertiseSettings.getTxPowerLevel() + ", timeout: " + mAdvertiseSettings.getTimeout() + ", is connectable: " + mAdvertiseSettings.isConnectable()); } else { throw new NullPointerException("The argument (AdvertiseSettings) cannot be null"); } } BleAdvertiser(Listener listener, BluetoothAdapter bluetoothAdapter);   BleAdvertiser(Listener listener, BluetoothAdapter bluetoothAdapter,
                  AdvertiseSettings.Builder builder, DiscoveryManagerSettings settings); void setAdvertiseSettings(AdvertiseSettings advertiseSettings); boolean isStarted(); synchronized boolean start(); synchronized void stop(boolean notifyStateChanged); @Override void onStartFailure(int errorCode); @Override void onStartSuccess(AdvertiseSettings settingsInEffect);  }