14
14
import java .sql .SQLException ;
15
15
16
16
import info .nightscout .androidaps .MainApp ;
17
+ import info .nightscout .androidaps .R ;
17
18
import info .nightscout .androidaps .db .DatabaseHelper ;
18
19
import info .nightscout .androidaps .db .DbRequest ;
19
20
import info .nightscout .androidaps .logging .L ;
20
21
import info .nightscout .androidaps .plugins .general .nsclient .services .NSClientService ;
22
+ import info .nightscout .androidaps .utils .SP ;
21
23
22
24
/**
23
25
* Created by mike on 21.02.2016.
@@ -42,21 +44,22 @@ private static void startService() {
42
44
}
43
45
44
46
public static void add (final DbRequest dbr ) {
47
+ if (SP .getBoolean (R .string .key_ns_noupload , false )) return ;
45
48
startService ();
46
- if (L .isEnabled (L .NSCLIENT ))
47
- log .debug ("Adding to queue: " + dbr .log ());
48
- try {
49
- MainApp .getDbHelper ().create (dbr );
50
- } catch (Exception e ) {
51
- log .error ("Unhandled exception" , e );
52
- }
53
- NSClientPlugin plugin = NSClientPlugin .getPlugin ();
54
- if (plugin != null ) {
55
- plugin .resend ("newdata" );
56
- }
49
+ if (L .isEnabled (L .NSCLIENT ))
50
+ log .debug ("Adding to queue: " + dbr .log ());
51
+ try {
52
+ MainApp .getDbHelper ().create (dbr );
53
+ } catch (Exception e ) {
54
+ log .error ("Unhandled exception" , e );
55
+ }
56
+ NSClientPlugin plugin = NSClientPlugin .getPlugin ();
57
+ if (plugin != null ) {
58
+ plugin .resend ("newdata" );
59
+ }
57
60
}
58
61
59
- public static void clearQueue () {
62
+ static void clearQueue () {
60
63
startService ();
61
64
if (NSClientService .handler != null ) {
62
65
NSClientService .handler .post (() -> {
@@ -104,7 +107,7 @@ public static void removeID(final String action, final String _id) {
104
107
}
105
108
}
106
109
107
- public String textList () {
110
+ String textList () {
108
111
String result = "" ;
109
112
CloseableIterator <DbRequest > iterator ;
110
113
try {
0 commit comments