Skip to content

Commit

Permalink
[TIMOB-20522] Improve validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Mathews committed Feb 21, 2018
1 parent 61e58ad commit 1c2288d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,12 @@ public static boolean validVersion()

public static boolean available(Context context)
{
googleApiCode = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context);
if (googleApiCode == ConnectionResult.SUCCESS) {
return true;
GoogleApiAvailability availability = GoogleApiAvailability.getInstance();
if (availability != null) {
googleApiCode = availability.isGooglePlayServicesAvailable(context);
if (googleApiCode == ConnectionResult.SUCCESS) {
return true;
}
}

Log.w(TAG, "Google Play Services is not available");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public LocationProviderProxy(String name, double minUpdateDistance, double minUp
*/
public Object getLocationCallback()
{
if (locationCallback == null && FusedLocationProvider.hasPlayServices(getActivity())) {
if (locationCallback == null && FusedLocationProvider.hasPlayServices(TiApplication.getAppRootOrCurrentActivity())) {
locationCallback = FusedLocationProvider.createLocationCallback(providerListener, getName());
}
return locationCallback;
Expand Down

0 comments on commit 1c2288d

Please sign in to comment.