Crappy hack to deal with applying the first profile switch.

This commit is contained in:
Johannes Mockenhaupt 2018-02-18 11:53:41 +01:00
parent 1e3f6dd192
commit 832138398f
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -2,6 +2,7 @@ package info.nightscout.androidaps.queue;
import android.content.Context;
import android.content.Intent;
import android.os.SystemClock;
import android.support.v7.app.AppCompatActivity;
import android.text.Html;
import android.text.Spanned;
@ -288,6 +289,9 @@ public class CommandQueue {
}
// Check that there is a valid profileSwitch NOW
if (MainApp.getConfigBuilder().getProfileSwitchFromHistory(System.currentTimeMillis())==null) {
// wait for DatabaseHelper.scheduleProfiSwitch() to do the profile switch // TODO clean this crap up
SystemClock.sleep(5000);
if (MainApp.getConfigBuilder().getProfileSwitchFromHistory(System.currentTimeMillis())==null) {
Notification noProfileSwitchNotif = new Notification(Notification.PROFILE_SWITCH_MISSING, MainApp.sResources.getString(R.string.profileswitch_ismissing), Notification.NORMAL);
MainApp.bus().post(new EventNewNotification(noProfileSwitchNotif));
@ -297,6 +301,7 @@ public class CommandQueue {
}
return false;
}
}
// Compare with pump limits
Profile.BasalValue[] basalValues = profile.getBasalValues();