mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-28 04:46:51 +01:00
Fix some LGTM issues
This commit is contained in:
parent
235c3fb599
commit
17f24c06f8
@ -632,8 +632,9 @@ public class GBApplication extends Application {
|
||||
DaoSession daoSession = db.getDaoSession();
|
||||
List<Device> activeDevices = DBHelper.getActiveDevices(daoSession);
|
||||
for (Device dbDevice : activeDevices) {
|
||||
SharedPreferences.Editor deviceSharedPrefsEdit = GBApplication.getDeviceSpecificSharedPrefs(dbDevice.getIdentifier()).edit();
|
||||
if (sharedPrefs != null) {
|
||||
SharedPreferences deviceSpecificSharedPrefs = GBApplication.getDeviceSpecificSharedPrefs(dbDevice.getIdentifier());
|
||||
if (deviceSpecificSharedPrefs != null) {
|
||||
SharedPreferences.Editor deviceSharedPrefsEdit = deviceSpecificSharedPrefs.edit();
|
||||
String preferenceKey = dbDevice.getIdentifier() + "_lastSportsActivityTimeMillis";
|
||||
long lastSportsActivityTimeMillis = sharedPrefs.getLong(preferenceKey, 0);
|
||||
if (lastSportsActivityTimeMillis != 0) {
|
||||
@ -708,9 +709,8 @@ public class GBApplication extends Application {
|
||||
if (newLanguage != null) {
|
||||
deviceSharedPrefsEdit.putString("language", newLanguage);
|
||||
}
|
||||
deviceSharedPrefsEdit.apply();
|
||||
}
|
||||
|
||||
deviceSharedPrefsEdit.apply();
|
||||
}
|
||||
editor.remove("amazfitbip_language");
|
||||
editor.remove("bip_display_items");
|
||||
|
@ -109,7 +109,7 @@ public class DbManagementActivity extends AbstractGBActivity {
|
||||
|
||||
Prefs prefs = GBApplication.getPrefs();
|
||||
boolean autoExportEnabled = prefs.getBoolean(GBPrefs.AUTO_EXPORT_ENABLED, false);
|
||||
Integer autoExportInterval = prefs.getInt(GBPrefs.AUTO_EXPORT_INTERVAL, 0);
|
||||
int autoExportInterval = prefs.getInt(GBPrefs.AUTO_EXPORT_INTERVAL, 0);
|
||||
//returns an ugly content://...
|
||||
//String autoExportLocation = prefs.getString(GBPrefs.AUTO_EXPORT_LOCATION, "");
|
||||
|
||||
|
@ -105,7 +105,7 @@ class AppMessageHandlerM7S extends AppMessageHandler {
|
||||
return HAIL;
|
||||
} else if (conditionCode >= 907 && conditionCode < 957) {
|
||||
return WIND;
|
||||
} else if (conditionCode == 905 || (conditionCode >= 957 && conditionCode < 900)) {
|
||||
} else if (conditionCode == 905) {
|
||||
return EXTREME_WIND;
|
||||
} else if (conditionCode == 900) {
|
||||
return TORNADO;
|
||||
|
@ -99,7 +99,7 @@ class AppMessageHandlerRealWeather extends AppMessageHandler {
|
||||
return CLOUD;
|
||||
} else if (conditionCode >= 907 && conditionCode < 957) {
|
||||
return STORM;
|
||||
} else if (conditionCode == 905 || (conditionCode >= 957 && conditionCode < 900)) {
|
||||
} else if (conditionCode == 905) {
|
||||
return STORM;
|
||||
} else if (conditionCode == 900) {
|
||||
return STORM;
|
||||
|
@ -88,7 +88,7 @@ private int getConditionForConditionCode(int conditionCode) {
|
||||
return HAIL;
|
||||
} else if (conditionCode >= 907 && conditionCode < 957) {
|
||||
return WIND;
|
||||
} else if (conditionCode == 905 || (conditionCode >= 957 && conditionCode < 900)) {
|
||||
} else if (conditionCode == 905) {
|
||||
return EXTREME_WIND;
|
||||
} else if (conditionCode == 900) {
|
||||
return TORNADO;
|
||||
|
@ -130,7 +130,7 @@ class AppMessageHandlerYWeather extends AppMessageHandler {
|
||||
return SLEET;
|
||||
} else if (conditionCode >= 907 && conditionCode < 957) {
|
||||
return STORM;
|
||||
} else if (conditionCode == 905 || (conditionCode >= 957 && conditionCode < 900)) {
|
||||
} else if (conditionCode == 905) {
|
||||
return STORM;
|
||||
} else if (conditionCode == 900) {
|
||||
return STORM;
|
||||
|
@ -2136,7 +2136,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLEDeviceSupport {
|
||||
ZeTimeConstants.CMD_END
|
||||
};
|
||||
|
||||
if (language.equals("default") || (language == null)) {
|
||||
if (language == null || language.equals("default")) {
|
||||
locale = Locale.getDefault();
|
||||
language = locale.getLanguage();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user