Commit 360de990 authored by Vyacheslav Koscheev's avatar Vyacheslav Koscheev

add try-catch to LocationRequest initialization

parent 7b3e7bad
......@@ -317,25 +317,31 @@ public class GmsLocationProvider implements ConnectionCallbacks, OnConnectionFai
Log.i(TAG, "startLocationUpdates");
LocationRequest request = new LocationRequest();
request
.setPriority(priority)
.setInterval(interval)
.setFastestInterval(fastestInterval);
if (maxWaitTime > 0) {
request.setMaxWaitTime(maxWaitTime);
}
try {
request
.setPriority(priority)
.setInterval(interval)
.setFastestInterval(fastestInterval);
if (numUpdates > 0) {
request.setNumUpdates(numUpdates);
}
if (maxWaitTime > 0) {
request.setMaxWaitTime(maxWaitTime);
}
if (expirationDuration > 0) {
request.setExpirationDuration(expirationDuration);
}
if (numUpdates > 0) {
request.setNumUpdates(numUpdates);
}
if (expirationDuration > 0) {
request.setExpirationDuration(expirationDuration);
}
if (expirationTime > 0) {
request.setExpirationTime(expirationTime);
if (expirationTime > 0) {
request.setExpirationTime(expirationTime);
}
}
catch (Throwable e) {
Log.e(TAG, "Failed to init LocationRequest", e);
}
final Long requestId = ++mLastRequestId;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment