From 1acefaea3c822cbb0b44de3694cb54eda1ab5b1c Mon Sep 17 00:00:00 2001 From: Roumen Georgiev Date: Wed, 11 Apr 2018 18:09:08 +0300 Subject: [PATCH] adding device name to AndroidAPS started note --- .../java/info/nightscout/utils/NSUpload.java | 28 +------------------ 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/app/src/main/java/info/nightscout/utils/NSUpload.java b/app/src/main/java/info/nightscout/utils/NSUpload.java index ad6cc45ab8..6cb110abde 100644 --- a/app/src/main/java/info/nightscout/utils/NSUpload.java +++ b/app/src/main/java/info/nightscout/utils/NSUpload.java @@ -466,7 +466,7 @@ public class NSUpload { try { data.put("eventType", "Note"); 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); } @@ -476,33 +476,7 @@ public class NSUpload { 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) { - 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()); - } } public static void uploadEvent(String careportalEvent, long time) {