Skip to content
Snippets Groups Projects
Commit 699b64b5 authored by Lennart Goedhart's avatar Lennart Goedhart
Browse files

Clean up lint warnings

parent 4261d48d
No related branches found
No related tags found
No related merge requests found
Showing
with 9 additions and 122 deletions
......@@ -43,7 +43,6 @@ import com.github.javiersantos.appupdater.AppUpdater;
import com.github.javiersantos.appupdater.enums.UpdateFrom;
import com.jjoe64.graphview.DefaultLabelFormatter;
import com.jjoe64.graphview.GraphView;
import com.jjoe64.graphview.Viewport;
import com.jjoe64.graphview.series.DataPoint;
import com.jjoe64.graphview.series.DataPointInterface;
import com.jjoe64.graphview.series.OnDataPointTapListener;
......@@ -252,6 +251,7 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
.withIcon(GoogleMaterial.Icon.gmd_update)
.withSelectable(false);
assert toolbar != null;
new DrawerBuilder()
.withActivity(this)
.withAccountHeader(new AccountHeaderBuilder()
......
......@@ -129,7 +129,7 @@ public class MedtronicCnlReader {
RequestLinkKeyResponseMessage response = new RequestLinkKeyRequestMessage(mPumpSession).send(mDevice);
this.getPumpSession().setKey(response.getKey());
Log.d(TAG, String.format("Finished requestLinkKey. linkKey = '%s'", this.getPumpSession().getKey()));
Log.d(TAG, String.format("Finished requestLinkKey. linkKey = '%s'", (Object) this.getPumpSession().getKey()));
}
public byte negotiateChannel(byte lastRadioChannel) throws IOException, ChecksumException, TimeoutException, EncryptionException {
......
......@@ -32,8 +32,7 @@ public class CloseConnectionRequestMessage extends ContourNextLinkBinaryRequestM
}
}
CloseConnectionResponseMessage response = this.getResponse(readMessage(mDevice));
return response;
return this.getResponse(readMessage(mDevice));
}
@Override
......
......@@ -46,8 +46,7 @@ public class PumpStatusRequestMessage extends MedtronicSendMessageRequestMessage
// clear unexpected incoming messages
clearMessage(mDevice);
PumpStatusResponseMessage response = this.getResponse(payload);
return response;
return this.getResponse(payload);
}
@Override
......
......@@ -41,8 +41,7 @@ public class PumpTimeRequestMessage extends MedtronicSendMessageRequestMessage<P
// Pump sends additional 0x80 message when not using EHSM, lets clear this and any unexpected incoming messages
clearMessage(mDevice);
PumpTimeResponseMessage response = this.getResponse(payload);
return response;
return this.getResponse(payload);
}
@Override
......
......@@ -238,11 +238,10 @@ public class MedtronicCnlIntentService extends IntentService {
sendStatus("SGV: " + MainActivity.strFormatSGV(pumpRecord.getSgv()) + " At: " + dateFormatter.format(pumpRecord.getSgvDate().getTime()) + " Pump: " + offsetSign + (pumpOffset / 1000L) + "sec"); //note: event time is currently stored with offset
// Check if pump sent old event when new expected
if (pumpRecord != null &&
dataStore.getLastPumpStatus() != null &&
if (dataStore.getLastPumpStatus() != null &&
dataStore.getLastPumpStatus().getPumpDate() != null &&
((pumpRecord.getPumpDate().getTime() - dataStore.getLastPumpStatus().getPumpDate().getTime()) < 5000L) &&
((timePollExpected - timePollStarted) < 5000L)) {
pumpRecord.getPumpDate().getTime() - dataStore.getLastPumpStatus().getPumpDate().getTime() < 5000L &&
timePollExpected - timePollStarted < 5000L) {
sendStatus("Pump sent old SGV event, re-polling...");
}
......
package info.nightscout.android.model.medtronicNg;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Date;
import info.nightscout.android.utils.ConfigurationStore;
import io.realm.RealmObject;
import io.realm.annotations.Ignore;
import io.realm.annotations.Index;
......
......@@ -108,7 +108,7 @@ class NightScoutUpload {
boolean uploaded = true;
if (glucoseEntries.size() > 0) {
Response<ResponseBody> result = glucoseEndpoints.sendEntries(glucoseEntries).execute();
uploaded = uploaded && result.isSuccessful();
uploaded = result.isSuccessful();
}
if (bolusEntries.size() > 0) {
Response<ResponseBody> result = bolusEndpoints.sendEntries(bolusEntries).execute();
......
......@@ -92,87 +92,6 @@
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center"
app:cardCornerRadius="4dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp">
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="center"
app:srcCompat="@drawable/battery_0" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView"
android:text="Units Remaining"
android:textAppearance="@style/TextAppearance.AppCompat.Caption" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imageView"
android:layout_centerHorizontal="true"
android:layout_centerInParent="true"
android:text="150.250"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.AppCompat.Headline" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center"
app:cardCornerRadius="4dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp">
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="center"
app:srcCompat="@drawable/battery_0" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView"
android:text="Units Remaining"
android:textAppearance="@style/TextAppearance.AppCompat.Caption" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imageView"
android:layout_centerHorizontal="true"
android:layout_centerInParent="true"
android:text="150.250"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.AppCompat.Headline" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</GridLayout>
<TextView
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">---</string>
<string name="app_name">600 Series Uploader</string>
<string name="eula_title">Disclaimer</string>
<string name="eula_accept">Accept</string>
......@@ -16,31 +14,11 @@
<item>Info</item>
<item>Debug</item>
</string-array>
<string name="title_activity_manage_cnl">Manage your Contour Next Link devices</string>
<!-- Strings related to login -->
<string name="prompt_username">CareLink Username</string>
<string name="prompt_password">Password</string>
<string name="action_sign_in">Retrieve keys for USB</string>
<string name="action_sign_in_short">Retrieve keys</string>
<string name="error_invalid_password">Password is required</string>
<string name="error_incorrect_password">The Username or password is incorrect</string>
<string name="error_client_protocol_exception">Could not communicate with server.</string>
<string name="error_io_exception">Could not connect to server.</string>
<string name="error_class_not_found_exception">Application code error.</string>
<string name="error_http_response">Server responded with error. Could be username or password problem.</string>
<string name="error_field_required">This field is required</string>
<string name="prompt_carelink_username_password">Please enter your CareLink details.\nThey will not be stored.</string>
<string name="close">Close</string>
<string name="register_contour_next_link">Registered Devices</string>
<string name="preferences_enable_crashlytics">prefs_enable_crashlytics</string>
<string name="preferences_enable_answers">prefs_enable_answers</string>
<string name="preferences_enable_remote_logcat">prefs_enable_remote_logcat</string>
<string name="menu_name_preferences">Preferences</string>
<string name="button_text_stop_uploading_data">Stop Uploading CGM Data</string>
<string name="button_text_clear_log">Clear Log</string>
<string name="button_text_get_now">Get Now</string>
<string name="button_text_start_uploading_data">Start Uploading CGM Data</string>
<string name="preference_eula_accepted">IUNDERSTAND</string>
<string name="preference_enable_rest_upload">EnableRESTUpload</string>
<string name="preference_enable_xdrip_plus">EnablexDripPlusUpload</string>
......@@ -48,9 +26,6 @@
<string name="text_unit_mmolxl">mmol/L</string>
<string name="text_unit_mgxdl">mg/dL</string>
<string name="title_activity_status">Uploader Status</string>
<string name="dummy_button">Dummy Button</string>
<string name="dummy_content">DUMMY\nCONTENT</string>
<string name="menu_name_status">Status</string>
<string name="menu_name_battery_status">unknown</string>
<string name="preference_api_secret">YOUR.API.SECRET</string>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment