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
This commit is contained in:
parent
ed4d063611
commit
377fffca69
@ -26,6 +26,8 @@ import android.os.RemoteException;
|
|||||||
import android.os.ServiceManager;
|
import android.os.ServiceManager;
|
||||||
import android.util.ArraySet;
|
import android.util.ArraySet;
|
||||||
import cyanogenmod.app.CMContextConstants;
|
import cyanogenmod.app.CMContextConstants;
|
||||||
|
import cyanogenmod.providers.CMSettings;
|
||||||
|
import cyanogenmod.providers.WeatherContract;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -142,9 +144,14 @@ public class CMWeatherManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
int tempUnit = CMSettings.Global.getInt(mContext.getContentResolver(),
|
||||||
|
CMSettings.Global.WEATHER_TEMPERATURE_UNIT,
|
||||||
|
WeatherContract.WeatherColumns.TempUnit.FAHRENHEIT);
|
||||||
|
|
||||||
RequestInfo info = new RequestInfo
|
RequestInfo info = new RequestInfo
|
||||||
.Builder(mRequestInfoListener)
|
.Builder(mRequestInfoListener)
|
||||||
.setLocation(location)
|
.setLocation(location)
|
||||||
|
.setTemperatureUnit(tempUnit)
|
||||||
.build();
|
.build();
|
||||||
if (listener != null) mWeatherUpdateRequestListeners.put(info, listener);
|
if (listener != null) mWeatherUpdateRequestListeners.put(info, listener);
|
||||||
sWeatherManagerService.updateWeather(info);
|
sWeatherManagerService.updateWeather(info);
|
||||||
@ -175,9 +182,14 @@ public class CMWeatherManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
int tempUnit = CMSettings.Global.getInt(mContext.getContentResolver(),
|
||||||
|
CMSettings.Global.WEATHER_TEMPERATURE_UNIT,
|
||||||
|
WeatherContract.WeatherColumns.TempUnit.FAHRENHEIT);
|
||||||
|
|
||||||
RequestInfo info = new RequestInfo
|
RequestInfo info = new RequestInfo
|
||||||
.Builder(mRequestInfoListener)
|
.Builder(mRequestInfoListener)
|
||||||
.setWeatherLocation(weatherLocation)
|
.setWeatherLocation(weatherLocation)
|
||||||
|
.setTemperatureUnit(tempUnit)
|
||||||
.build();
|
.build();
|
||||||
if (listener != null) mWeatherUpdateRequestListeners.put(info, listener);
|
if (listener != null) mWeatherUpdateRequestListeners.put(info, listener);
|
||||||
sWeatherManagerService.updateWeather(info);
|
sWeatherManagerService.updateWeather(info);
|
||||||
|
Loading…
Reference in New Issue
Block a user