1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-10-31 22:52:59 +01:00

Fix some lgtm warnings

This commit is contained in:
cpfeiffer 2019-02-28 21:57:45 +01:00
parent ebdf385baa
commit f3a7861fdb
5 changed files with 8 additions and 8 deletions

View File

@ -399,7 +399,7 @@ public class GBApplication extends Application {
private static void loadAppsNotifBlackList() {
GB.log("Loading apps_notification_blacklist", GB.INFO, null);
apps_notification_blacklist = (HashSet<String>) sharedPrefs.getStringSet(GBPrefs.PACKAGE_BLACKLIST, null);
apps_notification_blacklist = (HashSet<String>) sharedPrefs.getStringSet(GBPrefs.PACKAGE_BLACKLIST, null); // lgtm [java/abstract-to-concrete-cast]
if (apps_notification_blacklist == null) {
apps_notification_blacklist = new HashSet<>();
}
@ -451,7 +451,7 @@ public class GBApplication extends Application {
private static void loadAppsPebbleBlackList() {
GB.log("Loading apps_pebblemsg_blacklist", GB.INFO, null);
apps_pebblemsg_blacklist = (HashSet<String>) sharedPrefs.getStringSet(GBPrefs.PACKAGE_PEBBLEMSG_BLACKLIST, null);
apps_pebblemsg_blacklist = (HashSet<String>) sharedPrefs.getStringSet(GBPrefs.PACKAGE_PEBBLEMSG_BLACKLIST, null); // lgtm [java/abstract-to-concrete-cast]
if (apps_pebblemsg_blacklist == null) {
apps_pebblemsg_blacklist = new HashSet<>();
}
@ -523,7 +523,7 @@ public static String packageNameToPebbleMsgSender(String packageName) {
private static void loadCalendarsBlackList() {
GB.log("Loading calendars_blacklist", GB.INFO, null);
calendars_blacklist = (HashSet<String>) sharedPrefs.getStringSet(GBPrefs.CALENDAR_BLACKLIST, null);
calendars_blacklist = (HashSet<String>) sharedPrefs.getStringSet(GBPrefs.CALENDAR_BLACKLIST, null); // lgtm [java/abstract-to-concrete-cast]
if (calendars_blacklist == null) {
calendars_blacklist = new HashSet<>();
}

View File

@ -185,7 +185,7 @@ public class NotificationFilterActivity extends AbstractGBActivity {
notificationFilterEntryDao.deleteByKeyInTx(mFilterEntryIds);
Long filterId = notificationFilterDao.insertOrReplace(mNotificationFilter);
long filterId = notificationFilterDao.insertOrReplace(mNotificationFilter);
// only save words if filter mode != none
if (mNotificationFilter.getNotificationFilterMode() != NOTIFICATION_FILTER_MODE_NONE) {

View File

@ -356,7 +356,7 @@ public class DeviceCommunicationService extends Service implements SharedPrefere
}
/**
* @param text: original text
* @param text original text
* @return 'text' or a new String without non supported chars like emoticons, etc.
*/
private String sanitizeNotifText(String text) {

View File

@ -1044,12 +1044,12 @@ public class ZeTimeDeviceSupport extends AbstractBTLEDeviceSupport {
if (musicControlMsg[6] > volume) {
musicCmd.event = GBDeviceEventMusicControl.Event.VOLUMEUP;
if(volume < 90) {
volume += 10;
volume += (byte) 10;
}
} else {
musicCmd.event = GBDeviceEventMusicControl.Event.VOLUMEDOWN;
if(volume > 10) {
volume -= 10;
volume -= (byte) 10;
}
}
try {

View File

@ -88,7 +88,7 @@ public class EmojiConverter {
try {
return EmojiUtils.shortCodify(text);
} catch (Exception e){
LOG.warn("An exception occured when converting advanced emoji to ASCII", text);
LOG.warn("An exception occured when converting advanced emoji to ASCII: " + text);
return text;
}
}