1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-15 22:49:26 +01:00

Small fixlets

This commit is contained in:
cpfeiffer 2016-05-20 22:04:30 +02:00
parent 400ae2bc3b
commit d5cca84780

View File

@ -65,6 +65,9 @@ public class GBApplication extends Application {
private static Appender<ILoggingEvent> fileLogger; private static Appender<ILoggingEvent> fileLogger;
private static Prefs prefs; private static Prefs prefs;
private static GBPrefs gbPrefs; private static GBPrefs gbPrefs;
/**
* Note: is null on Lollipop and Kitkat
*/
private static NotificationManager notificationManager; private static NotificationManager notificationManager;
public static final String ACTION_QUIT public static final String ACTION_QUIT
@ -127,7 +130,7 @@ public class GBApplication extends Application {
LocalBroadcastManager.getInstance(this).registerReceiver(mReceiver, filterLocal); LocalBroadcastManager.getInstance(this).registerReceiver(mReceiver, filterLocal);
if (isRunningMarshmallowOrLater()) { if (isRunningMarshmallowOrLater()) {
notificationManager = (NotificationManager) context.getSystemService(context.NOTIFICATION_SERVICE); notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
} }
// for testing DB stuff // for testing DB stuff
@ -272,7 +275,7 @@ public class GBApplication extends Application {
boolean exists = false; boolean exists = false;
int starred = 0; int starred = 0;
try { try {
if (cursor.moveToFirst()) { if (cursor != null && cursor.moveToFirst()) {
exists = true; exists = true;
starred = cursor.getInt(cursor.getColumnIndexOrThrow(PhoneLookup.STARRED)); starred = cursor.getInt(cursor.getColumnIndexOrThrow(PhoneLookup.STARRED));
} }