adding device name to AndroidAPS started note
This commit is contained in:
parent
564e87d782
commit
1acefaea3c
1 changed files with 1 additions and 27 deletions
|
@ -466,33 +466,7 @@ public class NSUpload {
|
||||||
try {
|
try {
|
||||||
data.put("eventType", "Note");
|
data.put("eventType", "Note");
|
||||||
data.put("created_at", DateUtil.toISOString(new Date()));
|
data.put("created_at", DateUtil.toISOString(new Date()));
|
||||||
data.put("notes", MainApp.sResources.getString(R.string.androidaps_start));
|
data.put("notes", MainApp.sResources.getString(R.string.androidaps_start)+" - "+ Build.MANUFACTURER + " "+ Build.MODEL);
|
||||||
} catch (JSONException e) {
|
|
||||||
log.error("Unhandled exception", e);
|
|
||||||
}
|
|
||||||
bundle.putString("data", data.toString());
|
|
||||||
Intent intent = new Intent(Intents.ACTION_DATABASE);
|
|
||||||
intent.putExtras(bundle);
|
|
||||||
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
|
|
||||||
context.sendBroadcast(intent);
|
|
||||||
DbLogger.dbAdd(intent, data.toString());
|
|
||||||
// now adding another note with the device running AndroidAPS
|
|
||||||
uploadDeviceNote();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void uploadDeviceNote(){
|
|
||||||
if (SP.getBoolean(R.string.key_ns_logappstartedevent, true)) {
|
|
||||||
Context context = MainApp.instance().getApplicationContext();
|
|
||||||
Bundle bundle = new Bundle();
|
|
||||||
bundle.putString("action", "dbAdd");
|
|
||||||
bundle.putString("collection", "treatments");
|
|
||||||
JSONObject data = new JSONObject();
|
|
||||||
try {
|
|
||||||
data.put("eventType", "Note");
|
|
||||||
data.put("created_at", DateUtil.toISOString(new Date()));
|
|
||||||
data.put("notes", "Started on "+ Build.MANUFACTURER + " "+ Build.MODEL);
|
|
||||||
// log.debug("Running on: "+Build.MANUFACTURER + " "+ Build.MODEL);
|
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
log.error("Unhandled exception", e);
|
log.error("Unhandled exception", e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue