Skip to content
This repository has been archived by the owner on Mar 19, 2020. It is now read-only.

Commit

Permalink
Fixed possible crash with Fused Location provider
Browse files Browse the repository at this point in the history
Ensure that the update interval is not negative
  • Loading branch information
rock3r committed Nov 12, 2013
1 parent 4d140ec commit 5719bcb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/net/frakbot/FWeather/util/LocationHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ private long getMinUpdateInterval() {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mContext);
String valuePreference = sp.getString(Const.Preferences.SYNC_FREQUENCY, "300");
int value = Integer.decode(valuePreference);
if (value <= 0) {
value = 300;
try {
sp.edit().putString(Const.Preferences.SYNC_FREQUENCY, "300").commit();
}
catch (Exception ignored) {}
}
return value * 1000;
}

Expand Down

0 comments on commit 5719bcb

Please sign in to comment.