Issue #56 fixed

This commit is contained in:
Aleksander Nowakowski 2017-06-28 17:33:37 +02:00
parent 0799eb051b
commit c2e0e5fec9
1 changed files with 13 additions and 0 deletions

View File

@ -57,6 +57,7 @@ public class DfuServiceInitiator {
private int fileType = -1;
private boolean keepBond;
private boolean restoreBond;
private boolean forceDfu = false;
private boolean enableUnsafeExperimentalButtonlessDfu = false;
@ -111,6 +112,17 @@ public class DfuServiceInitiator {
return this;
}
/**
* Sets whether the bond should be created after the DFU is complete.
* Please see the {@link DfuBaseService#EXTRA_RESTORE_BOND} for more information regarding requirements.
* @param restoreBond whether the bond should be created after the DFU is complete.
* @return the builder
*/
public DfuServiceInitiator setRestoreBond(final boolean restoreBond) {
this.restoreBond = restoreBond;
return this;
}
/**
* Enables or disables the Packet Receipt Notification (PRN) procedure.
* <p>By default the PRNs are disabled on devices with Android Marshmallow or newer and enabled on older ones.</p>
@ -461,6 +473,7 @@ public class DfuServiceInitiator {
intent.putExtra(DfuBaseService.EXTRA_INIT_FILE_PATH, initFilePath);
intent.putExtra(DfuBaseService.EXTRA_INIT_FILE_RES_ID, initFileResId);
intent.putExtra(DfuBaseService.EXTRA_KEEP_BOND, keepBond);
intent.putExtra(DfuBaseService.EXTRA_RESTORE_BOND, restoreBond);
intent.putExtra(DfuBaseService.EXTRA_FORCE_DFU, forceDfu);
intent.putExtra(DfuBaseService.EXTRA_UNSAFE_EXPERIMENTAL_BUTTONLESS_DFU, enableUnsafeExperimentalButtonlessDfu);
if (packetReceiptNotificationsEnabled != null) {