diff --git a/app/build.gradle b/app/build.gradle index c4ade1bbe8..31de31b970 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -44,7 +44,7 @@ android { minSdkVersion 21 targetSdkVersion 23 versionCode 1100 - version "1.32" + version "1.33" buildConfigField "String", "VERSION", '"' + version + '"' buildConfigField "String", "BUILDVERSION", generateGitBuild() } diff --git a/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java b/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java index 132ac5d059..29a4913bc3 100644 --- a/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java @@ -11,7 +11,6 @@ import android.preference.PreferenceFragment; import android.preference.PreferenceGroup; import android.preference.PreferenceManager; - import info.nightscout.androidaps.events.EventPreferenceChange; import info.nightscout.androidaps.events.EventRefreshGui; import info.nightscout.androidaps.interfaces.PluginBase; @@ -50,14 +49,14 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre updatePrefSummary(myPreferenceFragment.getPreference(key)); } - private static void updatePrefSummary(Preference pref) { + private static void updatePrefSummary(Preference pref) { if (pref instanceof ListPreference || pref instanceof BluetoothDevicePreference) { ListPreference listPref = (ListPreference) pref; pref.setSummary(listPref.getEntry()); } if (pref instanceof EditTextPreference) { EditTextPreference editTextPref = (EditTextPreference) pref; - if (pref.getKey().contains("password")|| pref.getKey().contains("secret")) { + if (pref.getKey().contains("password") || pref.getKey().contains("secret")) { pref.setSummary("******"); } else if (editTextPref.getText() != null && !editTextPref.getText().equals("")) { ((EditTextPreference) pref).setDialogMessage(editTextPref.getDialogMessage()); @@ -119,11 +118,11 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre } VirtualPumpPlugin virtualPumpPlugin = (VirtualPumpPlugin) MainApp.getSpecificPlugin(VirtualPumpPlugin.class); if (virtualPumpPlugin != null && virtualPumpPlugin.isEnabled(PluginBase.PUMP)) { - addPreferencesFromResource(R.xml.pref_virtualpump); + addPreferencesFromResource(R.xml.pref_virtualpump); } NSClientInternalPlugin nsClientInternalPlugin = (NSClientInternalPlugin) MainApp.getSpecificPlugin(NSClientInternalPlugin.class); if (nsClientInternalPlugin != null && nsClientInternalPlugin.isEnabled(PluginBase.GENERAL)) { - addPreferencesFromResource(R.xml.pref_nsclientinternal); + addPreferencesFromResource(R.xml.pref_nsclientinternal); } if (Config.SMSCOMMUNICATORENABLED) addPreferencesFromResource(R.xml.pref_smscommunicator); @@ -131,7 +130,6 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre addPreferencesFromResource(R.xml.pref_others); addPreferencesFromResource(R.xml.pref_advanced); } - initSummary(getPreferenceScreen()); if (Config.WEAR) { WearPlugin wearPlugin = (WearPlugin) MainApp.getSpecificPlugin(WearPlugin.class); @@ -139,9 +137,11 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre addPreferencesFromResource(R.xml.pref_wear); } } + + initSummary(getPreferenceScreen()); } - public Preference getPreference (String key) { + public Preference getPreference(String key) { return findPreference(key); } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java index e1dacda013..2c42ffaa41 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java @@ -59,6 +59,7 @@ import info.nightscout.androidaps.plugins.NSClientInternal.data.DbLogger; import info.nightscout.androidaps.plugins.NSClientInternal.data.NSProfile; import info.nightscout.utils.BatteryLevel; import info.nightscout.utils.DateUtil; +import info.nightscout.utils.SP; /** * Created by mike on 05.08.2016. @@ -1128,24 +1129,26 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain } public void uploadAppStart() { - 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", MainApp.sResources.getString(R.string.androidaps_start)); - } catch (JSONException e) { - e.printStackTrace(); + 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", MainApp.sResources.getString(R.string.androidaps_start)); + } catch (JSONException e) { + e.printStackTrace(); + } + 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(), ConfigBuilderPlugin.class); } - 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(), ConfigBuilderPlugin.class); } } diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 8a2d1975c0..64eb3c63ab 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -531,4 +531,5 @@ Vzdálení příkaz není povolen K pozastavení smyčky na %d minut odpověz SMS s kódem %s Chybná doba trvání + Logovat spuštění aplikace do NS diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9ce906f8a1..c22459100d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -581,4 +581,6 @@ 15min trend COB Superbolus + Log app start to NS + ns_logappstartedevent diff --git a/app/src/main/res/xml/pref_nsclientinternal.xml b/app/src/main/res/xml/pref_nsclientinternal.xml index f6ea0cb48e..134bd9ca91 100644 --- a/app/src/main/res/xml/pref_nsclientinternal.xml +++ b/app/src/main/res/xml/pref_nsclientinternal.xml @@ -21,6 +21,10 @@ android:defaultValue="" android:inputType="textPassword"> + \ No newline at end of file