Merge branch 'smb-misc' into 'smb060'
Smb misc See merge request MilosKozak/AndroidAPS!381
This commit is contained in:
commit
d6f9dd819c
|
@ -1,8 +1,10 @@
|
|||
package info.nightscout.androidaps.Services;
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.AssetFileDescriptor;
|
||||
import android.media.AudioManager;
|
||||
import android.media.MediaPlayer;
|
||||
import android.os.IBinder;
|
||||
|
||||
|
@ -53,7 +55,10 @@ public class AlarmSoundService extends Service {
|
|||
log.error("Unhandled exception", e);
|
||||
}
|
||||
player.setLooping(true); // Set looping
|
||||
player.setVolume(100, 100);
|
||||
AudioManager manager = (AudioManager)this.getSystemService(Context.AUDIO_SERVICE);
|
||||
if (manager == null || !manager.isMusicActive()) {
|
||||
player.setVolume(100, 100);
|
||||
}
|
||||
|
||||
try {
|
||||
player.prepare();
|
||||
|
|
|
@ -57,6 +57,10 @@ public class PumpEnactResult extends Object {
|
|||
return this;
|
||||
}
|
||||
|
||||
public PumpEnactResult percent(Integer percent) {
|
||||
this.percent = percent;
|
||||
return this;
|
||||
}
|
||||
public PumpEnactResult isPercent(boolean isPercent) {
|
||||
this.isPercent = isPercent;
|
||||
return this;
|
||||
|
@ -111,7 +115,7 @@ public class PumpEnactResult extends Object {
|
|||
}
|
||||
|
||||
public Spanned toSpanned() {
|
||||
String ret = MainApp.sResources.getString(R.string.success) + ": " + success;
|
||||
String ret = "<b>" + MainApp.sResources.getString(R.string.success) + "</b>: " + success;
|
||||
if (queued) {
|
||||
ret = MainApp.sResources.getString(R.string.waitingforpumpresult);
|
||||
} else if (enacted) {
|
||||
|
@ -119,17 +123,20 @@ public class PumpEnactResult extends Object {
|
|||
ret += "<br><b>" + MainApp.sResources.getString(R.string.enacted) + "</b>: " + enacted;
|
||||
ret += "<br><b>" + MainApp.sResources.getString(R.string.comment) + "</b>: " + comment +
|
||||
"<br>" + MainApp.sResources.getString(R.string.canceltemp);
|
||||
} else if (isPercent) {
|
||||
} else if (isPercent && percent != -1) {
|
||||
ret += "<br><b>" + MainApp.sResources.getString(R.string.enacted) + "</b>: " + enacted;
|
||||
ret += "<br><b>" + MainApp.sResources.getString(R.string.comment) + "</b>: " + comment;
|
||||
ret += "<br><b>" + MainApp.sResources.getString(R.string.duration) + "</b>: " + duration + " min";
|
||||
ret += "<br><b>" + MainApp.sResources.getString(R.string.percent) + "</b>: " + percent + "%";
|
||||
} else {
|
||||
} else if (absolute != -1) {
|
||||
ret += "<br><b>" + MainApp.sResources.getString(R.string.enacted) + "</b>: " + enacted;
|
||||
ret += "<br><b>" + MainApp.sResources.getString(R.string.comment) + "</b>: " + comment;
|
||||
ret += "<br><b>" + MainApp.sResources.getString(R.string.duration) + "</b>: " + duration + " min";
|
||||
ret += "<br><b>" + MainApp.sResources.getString(R.string.absolute) + "</b>: " + DecimalFormatter.to2Decimal(absolute) + " U/h";
|
||||
}
|
||||
if (bolusDelivered > 0) {
|
||||
ret += "<br><b>" + MainApp.sResources.getString(R.string.bolus) + "</b>: " + DecimalFormatter.to2Decimal(bolusDelivered) + " U";
|
||||
}
|
||||
} else {
|
||||
ret += "<br><b>" + MainApp.sResources.getString(R.string.comment) + "</b>: " + comment;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue