KeepAliveReceiver: add alarm sound to 'pump unreachable' notification.

This commit is contained in:
Johannes Mockenhaupt 2017-10-26 00:12:38 +02:00
parent 7b3f474b58
commit 001a56728d
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -20,6 +20,7 @@ import java.util.Date;
import info.nightscout.androidaps.Constants; import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.PumpInterface; import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.plugins.Overview.Notification; import info.nightscout.androidaps.plugins.Overview.Notification;
@ -49,9 +50,9 @@ public class KeepAliveReceiver extends BroadcastReceiver {
SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext()); SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
if (isStatusOutdated && lastConnection.getTime() + 25 * 60 * 1000 < System.currentTimeMillis()) { if (isStatusOutdated && lastConnection.getTime() + 25 * 60 * 1000 < System.currentTimeMillis()) {
MainApp.bus().post(new EventNewNotification( Notification n = new Notification(Notification.PUMP_UNREACHABLE, "Pump unreachable", Notification.URGENT);
new Notification(Notification.PUMP_UNREACHABLE, n.soundId = R.raw.alarm;
"Pump connection could not be established for more than 25 minutes", Notification.URGENT))); MainApp.bus().post(new EventNewNotification(n));
} else if (SP.getBoolean("syncprofiletopump", false) && !pump.isThisProfileSet(profile)) { } else if (SP.getBoolean("syncprofiletopump", false) && !pump.isThisProfileSet(profile)) {
Thread t = new Thread(new Runnable() { Thread t = new Thread(new Runnable() {
@Override @Override