Make new behaviour configurable, default on.
(cherry picked from commit f807592
)
This commit is contained in:
parent
1cd4e72541
commit
df4ad822fc
|
@ -3,7 +3,9 @@ package info.nightscout.androidaps.plugins.Overview.Dialogs;
|
|||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.utils.NSUpload;
|
||||
import info.nightscout.utils.SP;
|
||||
|
||||
public class ErrorHelperActivity extends AppCompatActivity {
|
||||
public ErrorHelperActivity() {
|
||||
|
@ -20,6 +22,8 @@ public class ErrorHelperActivity extends AppCompatActivity {
|
|||
errorDialog.setTitle(getIntent().getStringExtra("title"));
|
||||
errorDialog.show(this.getSupportFragmentManager(), "Error");
|
||||
|
||||
NSUpload.uploadError(getIntent().getStringExtra("status"));
|
||||
if (SP.getBoolean(R.string.key_ns_create_announcements_from_errors, true)) {
|
||||
NSUpload.uploadError(getIntent().getStringExtra("status"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,7 +43,9 @@ public class LocalAlertUtils {
|
|||
n.soundId = R.raw.alarm;
|
||||
SP.putLong("nextPumpDisconnectedAlarm", System.currentTimeMillis() + pumpUnreachableThreshold());
|
||||
MainApp.bus().post(new EventNewNotification(n));
|
||||
NSUpload.uploadError(n.text);
|
||||
if (SP.getBoolean(R.string.key_ns_create_announcements_from_errors, true)) {
|
||||
NSUpload.uploadError(n.text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,7 +95,9 @@ public class LocalAlertUtils {
|
|||
n.soundId = R.raw.alarm;
|
||||
SP.putLong("nextMissedReadingsAlarm", System.currentTimeMillis() + missedReadingsThreshold());
|
||||
MainApp.bus().post(new EventNewNotification(n));
|
||||
NSUpload.uploadError(n.text);
|
||||
if (SP.getBoolean(R.string.key_ns_create_announcements_from_errors, true)) {
|
||||
NSUpload.uploadError(n.text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -878,5 +878,8 @@
|
|||
<string name="mute">Mute</string>
|
||||
<string name="about_link_urls">\n\nhttp://www.androidaps.org\nhttp://www.androidaps.de (de)\n\nfacebook:\nhttp://facebook.androidaps.org\nhttp://facebook.androidaps.de (de)</string>
|
||||
<string name="combo_check_date">The last bolus is older than 24 hours. Please check the date on the pump is set correctly.</string>
|
||||
<string name="key_ns_create_announcements_from_errors">ns_create_announcements_from_errors</string>
|
||||
<string name="ns_create_announcements_from_errors_title">Create announcements from errors</string>
|
||||
<string name="ns_create_announcements_from_errors_summary">Create Nightscout announcement for error dialogs and local alerts (also viewable in Careportal under Treatments)</string>
|
||||
</resources>
|
||||
|
||||
|
|
|
@ -27,6 +27,12 @@
|
|||
android:key="@string/key_ns_logappstartedevent"
|
||||
android:title="@string/ns_logappstartedevent" />
|
||||
|
||||
<SwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="@string/key_ns_create_announcements_from_errors"
|
||||
android:title="@string/ns_create_announcements_from_errors_title"
|
||||
android:summary="@string/ns_create_announcements_from_errors_summary"/>
|
||||
|
||||
<SwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="@string/key_ns_localbroadcasts"
|
||||
|
|
Loading…
Reference in a new issue