- added cpying to cplipboard for PodInfoRecentPulseLog (#41)
- added returning pumpId from addToHistory method, so that we can use it
This commit is contained in:
parent
9dee52cd0f
commit
54464cf2b6
|
@ -1,6 +1,9 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod;
|
||||
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.os.Bundle;
|
||||
|
@ -383,9 +386,13 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump
|
|||
} else {
|
||||
LOG.warn("Result was NOT null.");
|
||||
|
||||
ClipboardManager clipboard = (ClipboardManager) MainApp.instance().getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
ClipData clip = ClipData.newPlainText("PodInfoRecentPulseLog", result.toString());
|
||||
clipboard.setPrimaryClip(clip);
|
||||
|
||||
Intent i = new Intent(MainApp.instance(), ErrorHelperActivity.class);
|
||||
i.putExtra("soundid", R.raw.boluserror);
|
||||
i.putExtra("status", "Pulse Log:\n" + result.toString());
|
||||
i.putExtra("status", "Pulse Log (copied to clipboard):\n" + result.toString());
|
||||
i.putExtra("title", MainApp.gs(R.string.combo_warning));
|
||||
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
MainApp.instance().startActivity(i);
|
||||
|
|
|
@ -482,16 +482,16 @@ public class AapsOmnipodManager implements OmnipodCommunicationManagerInterface
|
|||
}
|
||||
|
||||
|
||||
public void addSuccessToHistory(long requestTime, PodHistoryEntryType entryType, Object data) {
|
||||
addToHistory(requestTime, entryType, data, true);
|
||||
public long addSuccessToHistory(long requestTime, PodHistoryEntryType entryType, Object data) {
|
||||
return addToHistory(requestTime, entryType, data, true);
|
||||
}
|
||||
|
||||
public void addFailureToHistory(long requestTime, PodHistoryEntryType entryType, Object data) {
|
||||
addToHistory(requestTime, entryType, data, false);
|
||||
public long addFailureToHistory(long requestTime, PodHistoryEntryType entryType, Object data) {
|
||||
return addToHistory(requestTime, entryType, data, false);
|
||||
}
|
||||
|
||||
|
||||
public void addToHistory(long requestTime, PodHistoryEntryType entryType, Object data, boolean success) {
|
||||
public long addToHistory(long requestTime, PodHistoryEntryType entryType, Object data, boolean success) {
|
||||
|
||||
PodHistory podHistory = new PodHistory(requestTime, entryType);
|
||||
|
||||
|
@ -508,6 +508,8 @@ public class AapsOmnipodManager implements OmnipodCommunicationManagerInterface
|
|||
|
||||
MainApp.getDbHelper().createOrUpdate(podHistory);
|
||||
|
||||
return podHistory.getPumpId();
|
||||
|
||||
}
|
||||
|
||||
private void handleSetupActionResult(PodInitActionType podInitActionType, PodInitReceiver podInitReceiver, SetupActionResult res, long time) {
|
||||
|
|
Loading…
Reference in a new issue