aboutsummaryrefslogtreecommitdiffstats
path: root/cm
diff options
context:
space:
mode:
authorLuis Vidal <lvidal@cyngn.com>2016-04-06 18:54:27 -0700
committerLuis Vidal <lvidal@cyngn.com>2016-04-08 11:17:22 -0700
commitbaaf4a1bafb652b5d49e739e5378087144a6e410 (patch)
tree4b2fc337af2831656af794577f70ad8f931e0446 /cm
parent06d5c89c437cd9a25078c10c5198bf67c789902e (diff)
downloadvendor_cmsdk-baaf4a1bafb652b5d49e739e5378087144a6e410.zip
vendor_cmsdk-baaf4a1bafb652b5d49e739e5378087144a6e410.tar.gz
vendor_cmsdk-baaf4a1bafb652b5d49e739e5378087144a6e410.tar.bz2
Refactor WeatherInfo class
- Builder constructor takes now 3 args: city name, temp and temp unit. This is the minimun data that a weather service should provide when a weather update request is processed. - Float members have been changed to double. Setter/getter methods updated. - New setter/getter methods have been added to set current day high and low temp. Forecast list should be used only to provide weather forecast for upcoming days (this has been clearly documented). WeatherContract was updated to include these 2 new columns - Added javadoc to all public methods - Timestamp is not longer required in constructor. A new method setTimestamp has been added Change-Id: Ia1edcfef0e2268f3881fed076c6ad74a81ca7334 TICKET: CYNGNOS-2365 TICKET: CYNGNOS-2382 TICKET: CYNGNOS-2356 TICKET: CYNGNOS-2360
Diffstat (limited to 'cm')
-rw-r--r--cm/lib/main/java/org/cyanogenmod/platform/internal/CMWeatherManagerService.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/cm/lib/main/java/org/cyanogenmod/platform/internal/CMWeatherManagerService.java b/cm/lib/main/java/org/cyanogenmod/platform/internal/CMWeatherManagerService.java
index d34454e..aa8358e 100644
--- a/cm/lib/main/java/org/cyanogenmod/platform/internal/CMWeatherManagerService.java
+++ b/cm/lib/main/java/org/cyanogenmod/platform/internal/CMWeatherManagerService.java
@@ -398,16 +398,17 @@ public class CMWeatherManagerService extends SystemService{
List<ContentValues> contentValuesList = new ArrayList<>(size);
ContentValues contentValues = new ContentValues();
- contentValues.put(WeatherColumns.CURRENT_CITY_ID, wi.getCityId());
contentValues.put(WeatherColumns.CURRENT_CITY, wi.getCity());
- contentValues.put(WeatherColumns.CURRENT_CONDITION_CODE, wi.getConditionCode());
- contentValues.put(WeatherColumns.CURRENT_HUMIDITY, wi.getHumidity());
contentValues.put(WeatherColumns.CURRENT_TEMPERATURE, wi.getTemperature());
contentValues.put(WeatherColumns.CURRENT_TEMPERATURE_UNIT, wi.getTemperatureUnit());
- contentValues.put(WeatherColumns.CURRENT_TIMESTAMP, wi.getTimestamp());
- contentValues.put(WeatherColumns.CURRENT_WIND_DIRECTION, wi.getWindDirection());
+ contentValues.put(WeatherColumns.CURRENT_CONDITION_CODE, wi.getConditionCode());
+ contentValues.put(WeatherColumns.CURRENT_HUMIDITY, wi.getHumidity());
contentValues.put(WeatherColumns.CURRENT_WIND_SPEED, wi.getWindSpeed());
+ contentValues.put(WeatherColumns.CURRENT_WIND_DIRECTION, wi.getWindDirection());
contentValues.put(WeatherColumns.CURRENT_WIND_SPEED_UNIT, wi.getWindSpeedUnit());
+ contentValues.put(WeatherColumns.CURRENT_TIMESTAMP, wi.getTimestamp());
+ contentValues.put(WeatherColumns.TODAYS_HIGH_TEMPERATURE, wi.getTodaysHigh());
+ contentValues.put(WeatherColumns.TODAYS_LOW_TEMPERATURE, wi.getTodaysLow());
contentValuesList.add(contentValues);
for (WeatherInfo.DayForecast df : wi.getForecasts()) {