Review fixes.

This commit is contained in:
Vladimir Byko-Ianko 2016-08-23 09:42:58 +03:00
parent 5d3f153141
commit 8c60dd29f2
2 changed files with 9 additions and 5 deletions

View file

@ -255,6 +255,10 @@ public enum LocationHelper
public void initProvider(boolean forceNative)
{
mActive = !mListeners.isEmpty();
if (mActive)
stopInternal();
final MwmApplication application = MwmApplication.get();
final boolean containsGoogleServices = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(application) == ConnectionResult.SUCCESS;
final boolean googleServicesTurnedInSettings = Config.useGoogleServices();

View file

@ -52,11 +52,11 @@ public class MiscPrefsFragment extends BaseXmlSettingsFragment
{
boolean oldVal = Config.useGoogleServices();
boolean newVal = ((Boolean) newValue).booleanValue();
if (oldVal == newVal)
return true;
Config.setUseGoogleService(newVal);
LocationHelper.INSTANCE.initProvider(false);
if (oldVal != newVal)
{
Config.setUseGoogleService(newVal);
LocationHelper.INSTANCE.initProvider(false /* forceNative */);
}
return true;
}
});