diff options
author | Luis Vidal <lvidal@cyngn.com> | 2016-04-12 23:59:32 -0700 |
---|---|---|
committer | Luis Vidal <lvidal@cyngn.com> | 2016-04-13 14:56:24 -0700 |
commit | 377fffca6989304ec61e33dacb0dd3fba8345262 (patch) | |
tree | fbaba8af1c6eef8b3ea0bf8a14ba21c9ca2826f9 /sdk | |
parent | ed4d063611d9f36d03a1679e773af1f5efd24734 (diff) | |
download | vendor_cmsdk-377fffca6989304ec61e33dacb0dd3fba8345262.zip vendor_cmsdk-377fffca6989304ec61e33dacb0dd3fba8345262.tar.gz vendor_cmsdk-377fffca6989304ec61e33dacb0dd3fba8345262.tar.bz2 |
Use temperature unit from CMSettings on weather update requests
Make sure the the weather update requests are using the temperature
unit set by the user in the weather settings
Change-Id: Iac3a891b5afbcf36a87386f828b40bcbd0e1de02
TICKET: CYNGNOS-2429
Diffstat (limited to 'sdk')
-rw-r--r-- | sdk/src/java/cyanogenmod/weather/CMWeatherManager.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sdk/src/java/cyanogenmod/weather/CMWeatherManager.java b/sdk/src/java/cyanogenmod/weather/CMWeatherManager.java index 2613ea5..545c3ce 100644 --- a/sdk/src/java/cyanogenmod/weather/CMWeatherManager.java +++ b/sdk/src/java/cyanogenmod/weather/CMWeatherManager.java @@ -26,6 +26,8 @@ import android.os.RemoteException; import android.os.ServiceManager; import android.util.ArraySet; import cyanogenmod.app.CMContextConstants; +import cyanogenmod.providers.CMSettings; +import cyanogenmod.providers.WeatherContract; import java.util.ArrayList; import java.util.Collections; @@ -142,9 +144,14 @@ public class CMWeatherManager { } try { + int tempUnit = CMSettings.Global.getInt(mContext.getContentResolver(), + CMSettings.Global.WEATHER_TEMPERATURE_UNIT, + WeatherContract.WeatherColumns.TempUnit.FAHRENHEIT); + RequestInfo info = new RequestInfo .Builder(mRequestInfoListener) .setLocation(location) + .setTemperatureUnit(tempUnit) .build(); if (listener != null) mWeatherUpdateRequestListeners.put(info, listener); sWeatherManagerService.updateWeather(info); @@ -175,9 +182,14 @@ public class CMWeatherManager { } try { + int tempUnit = CMSettings.Global.getInt(mContext.getContentResolver(), + CMSettings.Global.WEATHER_TEMPERATURE_UNIT, + WeatherContract.WeatherColumns.TempUnit.FAHRENHEIT); + RequestInfo info = new RequestInfo .Builder(mRequestInfoListener) .setWeatherLocation(weatherLocation) + .setTemperatureUnit(tempUnit) .build(); if (listener != null) mWeatherUpdateRequestListeners.put(info, listener); sWeatherManagerService.updateWeather(info); |