Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6bf7d5b authored by Danesh Mondegarian's avatar Danesh Mondegarian
Browse files

LockscreenWeather : Fix manual sync

Add a check to avoid logic fail for manual updates

Patchset 2 - Address first boot for manual sync

Change-Id: Id28fda707da5bab57ddc0b0a07c2939a0607aa44
parent df60741b
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -349,8 +349,11 @@ class KeyguardStatusViewManager implements OnClickListener {
        if (showWeather) {
            final long interval = Settings.System.getLong(resolver,
                    Settings.System.WEATHER_UPDATE_INTERVAL, 60); // Default to hourly
            if (((System.currentTimeMillis() - mWeatherInfo.last_sync) / 60000) >= interval) {
            boolean manualSync = (interval == 0);
            if (!manualSync && (((System.currentTimeMillis() - mWeatherInfo.last_sync) / 60000) >= interval)) {
                mHandler.sendEmptyMessage(QUERY_WEATHER);
            } else if (manualSync && mWeatherInfo.last_sync == 0) {
                setNoWeatherData();
            } else {
                setWeatherData(mWeatherInfo);
            }