diff options
Diffstat (limited to 'src/com/cyanogenmod/lockclock/weather/WeatherUpdateService.java')
-rw-r--r-- | src/com/cyanogenmod/lockclock/weather/WeatherUpdateService.java | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/com/cyanogenmod/lockclock/weather/WeatherUpdateService.java b/src/com/cyanogenmod/lockclock/weather/WeatherUpdateService.java index 1fd6f70..f5254ca 100644 --- a/src/com/cyanogenmod/lockclock/weather/WeatherUpdateService.java +++ b/src/com/cyanogenmod/lockclock/weather/WeatherUpdateService.java @@ -44,12 +44,13 @@ import com.cyanogenmod.lockclock.misc.Constants; import com.cyanogenmod.lockclock.misc.Preferences; import com.cyanogenmod.lockclock.misc.WidgetUtils; import com.cyanogenmod.lockclock.preference.WeatherPreferences; -import com.google.android.gms.common.ConnectionResult; -import com.google.android.gms.common.GooglePlayServicesUtil; + import cyanogenmod.weather.CMWeatherManager; import cyanogenmod.weather.WeatherInfo; import cyanogenmod.weather.WeatherLocation; +import org.cyanogenmod.internal.util.PackageManagerUtils; + import java.lang.ref.WeakReference; import java.util.Date; @@ -344,7 +345,7 @@ public class WeatherUpdateService extends Service { String locationProvider = lm.getBestProvider(sLocationCriteria, true); if (TextUtils.isEmpty(locationProvider)) { Log.e(TAG, "No available location providers matching criteria."); - } else if (isGooglePlayServicesAvailable() + } else if (PackageManagerUtils.isAppInstalled(mContext, "com.google.android.gms") && locationProvider.equals(LocationManager.GPS_PROVIDER)) { // Since Google Play services is available, // let's conserve battery power and not depend on the device's GPS. @@ -356,12 +357,6 @@ public class WeatherUpdateService extends Service { return location; } - private boolean isGooglePlayServicesAvailable() { - int result = GooglePlayServicesUtil.isGooglePlayServicesAvailable(mContext); - return result == ConnectionResult.SUCCESS - || result == ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED; - } - private void onWeatherRequestCompleted(WeatherInfo result) { if (D) Log.d(TAG, "Weather update received, caching data and updating widget"); cancelTimeoutAlarm(); |