Don't set location if user isn't logged in
parent
289743142c
commit
6f8841a7f8
|
@ -265,6 +265,8 @@ public class LocationService extends Service implements GoogleApiClient.Connecti
|
||||||
@Override
|
@Override
|
||||||
public void onLocationChanged(Location location) {
|
public void onLocationChanged(Location location) {
|
||||||
|
|
||||||
|
// Make sure we're logged in...
|
||||||
|
if (mUserID!=null && mUserSK!=null) {
|
||||||
JSONObject mLocationView = new JSONObject();
|
JSONObject mLocationView = new JSONObject();
|
||||||
try {
|
try {
|
||||||
mLocationView.put("usr", mUserID);
|
mLocationView.put("usr", mUserID);
|
||||||
|
@ -277,7 +279,11 @@ public class LocationService extends Service implements GoogleApiClient.Connecti
|
||||||
Log.e(TAG, "Failed to put JSON data");
|
Log.e(TAG, "Failed to put JSON data");
|
||||||
}
|
}
|
||||||
socket.emit("set", mLocationView);
|
socket.emit("set", mLocationView);
|
||||||
Log.v(TAG, "Location updated: " + mLocationView.toString());
|
Log.v(TAG, "Location set: " + mLocationView.toString());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Log.v(TAG, "Can't set location because user isn't logged in.");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue