Version 1.18.4

This commit is contained in:
Aleksander Nowakowski
2016-09-26 17:25:26 +02:00
parent 29b48d88d9
commit de66db95be
6 changed files with 28 additions and 9 deletions

View File

@@ -8,8 +8,8 @@ android {
applicationId "no.nordicsemi.android.nrftoolbox"
minSdkVersion 18
targetSdkVersion 24
versionCode 50
versionName "1.18.3"
versionCode 51
versionName "1.18.4"
}
buildTypes {
release {
@@ -45,7 +45,7 @@ dependencies {
wearApp project(':wear')
// The DFU Library is imported automatically from jcenter.
compile 'no.nordicsemi.android:dfu:1.0.3'
compile 'no.nordicsemi.android:dfu:1.0.4'
// If you want to make some changes in the DFU Library, clone the https://github.com/NordicSemiconductor/Android-DFU-Library project into DFULibrary folder,
// add it as a module in Project Structure and uncomment the following line:

View File

@@ -38,6 +38,7 @@ import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
@@ -673,10 +674,22 @@ public class DfuActivity extends AppCompatActivity implements LoaderCallbacks<Cu
showProgressBar();
final boolean keepBond = preferences.getBoolean(SettingsFragment.SETTINGS_KEEP_BOND, false);
final boolean forceDfu = preferences.getBoolean(SettingsFragment.SETTINGS_ASSUME_DFU_NODE, false);
final boolean enablePRNs = preferences.getBoolean(SettingsFragment.SETTINGS_PACKET_RECEIPT_NOTIFICATION_ENABLED, Build.VERSION.SDK_INT < Build.VERSION_CODES.M);
String value = preferences.getString(SettingsFragment.SETTINGS_NUMBER_OF_PACKETS, String.valueOf(DfuServiceInitiator.DEFAULT_PRN_VALUE));
int numberOfPackets;
try {
numberOfPackets = Integer.parseInt(value);
} catch (final NumberFormatException e) {
numberOfPackets = DfuServiceInitiator.DEFAULT_PRN_VALUE;
}
final DfuServiceInitiator starter = new DfuServiceInitiator(mSelectedDevice.getAddress())
.setDeviceName(mSelectedDevice.getName())
.setKeepBond(keepBond);
.setKeepBond(keepBond)
.setForceDfu(forceDfu)
.setPacketsReceiptNotificationsEnabled(enablePRNs)
.setPacketsReceiptNotificationsValue(numberOfPackets);
if (mFileType == DfuService.TYPE_AUTO)
starter.setZip(mFileStreamUri, mFilePath);
else {

View File

@@ -46,4 +46,9 @@ public class DfuService extends DfuBaseService {
return NotificationActivity.class;
}
@Override
protected boolean isDebug() {
// return BuildConfig.DEBUG;
return true;
}
}

View File

@@ -22,6 +22,7 @@
package no.nordicsemi.android.nrftoolbox.dfu.settings;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceFragment;
import android.preference.PreferenceScreen;
@@ -67,7 +68,7 @@ public class SettingsFragment extends PreferenceFragment implements DfuSettingsC
if (SETTINGS_PACKET_RECEIPT_NOTIFICATION_ENABLED.equals(key)) {
final boolean disabled = !preferences.getBoolean(SETTINGS_PACKET_RECEIPT_NOTIFICATION_ENABLED, true);
if (disabled) {
if (disabled && Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
new AlertDialog.Builder(getActivity()).setMessage(R.string.dfu_settings_dfu_number_of_packets_info).setTitle(R.string.dfu_settings_dfu_information)
.setPositiveButton(R.string.ok, null).show();
}
@@ -95,7 +96,7 @@ public class SettingsFragment extends PreferenceFragment implements DfuSettingsC
screen.findPreference(SETTINGS_NUMBER_OF_PACKETS).setSummary(value);
final int valueInt = Integer.parseInt(value);
if (valueInt > 200) {
if (valueInt > 200 && Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
new AlertDialog.Builder(getActivity()).setMessage(R.string.dfu_settings_dfu_number_of_packets_info).setTitle(R.string.dfu_settings_dfu_information)
.setPositiveButton(R.string.ok, null)
.show();

View File

@@ -30,7 +30,7 @@
android:title="@string/dfu_settings_dfu_packets_receipt_notification_label" />
<EditTextPreference
android:defaultValue="10"
android:defaultValue="12"
android:dependency="settings_packet_receipt_notification_enabled"
android:inputType="number"
android:key="settings_number_of_packets"

View File

@@ -8,8 +8,8 @@ android {
applicationId "no.nordicsemi.android.nrftoolbox"
minSdkVersion 20
targetSdkVersion 24
versionCode 50
versionName "1.18.3"
versionCode 51
versionName "1.18.4"
}
buildTypes {
release {