EXTRA_KEEP_BOND

val EXTRA_KEEP_BOND: String = "no.nordicsemi.android.dfu.extra.EXTRA_KEEP_BOND"

This flag indicated whether the bond information should be kept or removed after an upgrade of the Application. If an application is being updated on a bonded device with the DFU Bootloader that has been configured to preserve the bond information for the new application, set it to true.

By default the Legacy DFU Bootloader clears the whole application's memory. It may be, however, configured in the \Nordic\nrf51\components\libraries\bootloader_dfu\dfu_types.h file (sdk 11, line 76: #define DFU_APP_DATA_RESERVED 0x0000) to preserve some pages. The BLE_APP_HRM_DFU sample app stores the LTK and System Attributes in the first two pages, so in order to preserve the bond information this value should be changed to 0x0800 or more. For Secure DFU this value is by default set to 3 pages. When those data are preserved, the new Application will notify the app with the Service Changed indication when launched for the first time. Otherwise this service will remove the bond information from the phone and force to refresh the device cache (see refreshDeviceCache).

In contrast to EXTRA_RESTORE_BOND this flag will not remove the old bonding and recreate a new one, but will keep the bond information untouched.

The default value of this flag is false.

This flag is ignored when Secure DFU Buttonless Service is used. It will keep or remove the bond depending on the Buttonless service type.