New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TIMOB-23135] Fix Android: Ti.Geolocation.locationServicesEnabled retur… #8903
Conversation
} | ||
|
||
return false; | ||
return providerNames.size()!=0 & getLastKnownLocation()!=null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return providerNames.size() > 0 && getLastKnownLocation() != null;
Space the conditional operators and use a logical &&
instead of a bitwise &
(even though the bitwise & is still valid in this case)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
providerNames.size() is always >=1 because there is passive provider.
But having passive provider doesn't guarantee there is a location available, and when there is a lastKnownLocation available doesn't guarantee there's other service provider available. That's why I didn't use short circuit &&. Does it make sense?
FR Passed.
Studio Ver : 4.8.1.201612050850 |
@maggieaxway Little confusion here: You approved your own PR, but @garymathews didn't so far. We should be cautious with that. |
@hansemannn Noted thanks. Sorry for the confusion, I didn't mean to approve the PR. |
…ns false
Test case:
JIRA: https://jira.appcelerator.org/browse/TIMOB-23135