Crappy hack to deal with applying the first profile switch.
This commit is contained in:
parent
1e3f6dd192
commit
832138398f
1 changed files with 11 additions and 6 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue