1.33 app start logging optional

This commit is contained in:
Milos Kozak 2017-04-14 15:33:39 +02:00
parent 2413fae0a9
commit 402768cb87
6 changed files with 35 additions and 25 deletions

View file

@ -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()
}

View file

@ -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;
@ -57,7 +56,7 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre
}
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());
@ -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);
}
}

View file

@ -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,6 +1129,7 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain
}
public void uploadAppStart() {
if (SP.getBoolean(R.string.key_ns_logappstartedevent, true)) {
Context context = MainApp.instance().getApplicationContext();
Bundle bundle = new Bundle();
bundle.putString("action", "dbAdd");
@ -1147,5 +1149,6 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain
context.sendBroadcast(intent);
DbLogger.dbAdd(intent, data.toString(), ConfigBuilderPlugin.class);
}
}
}

View file

@ -531,4 +531,5 @@
<string name="smscommunicator_remotecommandnotallowed">Vzdálení příkaz není povolen</string>
<string name="smscommunicator_suspendreplywithcode" formatted="false">K pozastavení smyčky na %d minut odpověz SMS s kódem %s</string>
<string name="smscommunicator_wrongduration">Chybná doba trvání</string>
<string name="ns_logappstartedevent">Logovat spuštění aplikace do NS</string>
</resources>

View file

@ -581,4 +581,6 @@
<string name="treatments_wizard_bgtrend_label">15min trend</string>
<string name="treatments_wizard_cob_label">COB</string>
<string name="treatments_wizard_sb_label">Superbolus</string>
<string name="ns_logappstartedevent">Log app start to NS</string>
<string name="key_ns_logappstartedevent" translatable="false">ns_logappstartedevent</string>
</resources>

View file

@ -21,6 +21,10 @@
android:defaultValue=""
android:inputType="textPassword">
</EditTextPreference>
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_ns_logappstartedevent"
android:title="@string/ns_logappstartedevent" />
</PreferenceCategory>
</PreferenceScreen>