Skip to content

Commit

Permalink
remove all logs
Browse files Browse the repository at this point in the history
  • Loading branch information
chandrakant naik committed Jan 1, 2020
1 parent bc101c6 commit e97839e
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 52 deletions.
102 changes: 69 additions & 33 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private void setRunTimePermission() {
//set location permission
// Log.d(TAG, "SHOW PERMISSION DIALOG");
if (!getActivityCallback().isAttached()) {
Log.e("PERMISSION", "PERMISSION NOT GRANTED FOR LOCATION");
// Log.e("PERMISSION", "PERMISSION NOT GRANTED FOR LOCATION");
} else {
getActivityCallback().requestPermissions(new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, REQUEST_PERMISSIONS_REQUEST_CODE);
}
Expand All @@ -263,13 +263,13 @@ private boolean checkPermission() {

private void startLocationUpdates() {
if (!getActivityCallback().isAttached()) {
Log.w("", "No activity is attached to location manager");
// Log.w("", "No activity is attached to location manager");
//Here we will start without checking the conditions since we don't
//have the context but it might be running in the background
try {
requestLocationUpdates();
} catch (Exception e) {
Log.e(TAG, "startLocationUpdates: Error occurred might be since there is no activity attached");
// Log.e(TAG, "startLocationUpdates: Error occurred might be since there is no activity attached");
locationUpdateStarted = false;
}
} else {
Expand All @@ -284,7 +284,7 @@ private void startLocationUpdates() {
.addOnSuccessListener(new OnSuccessListener<LocationSettingsResponse>() {
@Override
public void onSuccess(LocationSettingsResponse locationSettingsResponse) {
Log.i(TAG, "All location settings are satisfied.");
// Log.i(TAG, "All location settings are satisfied.");
//noinspection MissingPermission
if (!getActivityCallback().checkSelfPermission(android.Manifest.permission.ACCESS_COARSE_LOCATION)) {
return;
Expand All @@ -298,10 +298,10 @@ public void onFailure(@NonNull Exception e) {
int statusCode = ((ApiException) e).getStatusCode();
switch (statusCode) {
case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:
Log.i(TAG, "Location settings are not satisfied. Attempting to upgrade " +
"location settings ");
// Log.i(TAG, "Location settings are not satisfied. Attempting to upgrade " +
// "location settings ");
if (!getActivityCallback().isAttached()) {
Log.e("PERMISSION", "LOCATION SERVICES ARE DISABLED");
// Log.e("PERMISSION", "LOCATION SERVICES ARE DISABLED");
} else {
getActivityCallback().showGPSSettingDialog(e, REQUEST_CHECK_SETTINGS);
}
Expand Down Expand Up @@ -377,15 +377,15 @@ private boolean filterAndAddLocation(Location location) {
}

if (location.getAccuracy() <= 0) {
Log.d(TAG, "Latitid and longitude values are invalid.");
// Log.d(TAG, "Latitid and longitude values are invalid.");
// noAccuracyLocationList.add(location);
return false;
}

//setAccuracy(newLocation.getAccuracy());
float horizontalAccuracy = location.getAccuracy();
if (horizontalAccuracy > 10) { //10meter filter
Log.d(TAG, "Accuracy is too low.");
// Log.d(TAG, "Accuracy is too low.");
// inaccurateLocationList.add(location);
disposeBag.notifyAll(new TTNewLocation(location.getLatitude(), location.getLongitude(), false, location.getAccuracy(), location.getBearing(), location.getAltitude(), extraPayload));
return false;
Expand Down Expand Up @@ -415,7 +415,7 @@ private boolean filterAndAddLocation(Location location) {
float predictedDeltaInMeters = predictedLocation.distanceTo(location);

if (predictedDeltaInMeters > 60) {
Log.d(TAG, "Kalman Filter detects mal GPS, we should probably remove this from track");
// Log.d(TAG, "Kalman Filter detects mal GPS, we should probably remove this from track");
kalmanFilter.consecutiveRejectCount += 1;

if (kalmanFilter.consecutiveRejectCount > 3) {
Expand All @@ -427,7 +427,7 @@ private boolean filterAndAddLocation(Location location) {
kalmanFilter.consecutiveRejectCount = 0;
}

Log.d(TAG, "Location quality is good enough.");
// Log.d(TAG, "Location quality is good enough.");
//Code to notify all observers that we got a good location
disposeBag.notifyAll(new TTNewLocation(predictedLocation.getLatitude()
, predictedLocation.getLongitude(), true, predictedLocation.getAccuracy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,23 @@ public static Double getAltitudeMeanSeaLevel(String nmeaSentence) {
try {
altitude = tokens[ALTITUDE_INDEX];
} catch (ArrayIndexOutOfBoundsException e) {
Log.e(TAG, "Bad NMEA sentence for geoid altitude - " + nmeaSentence + " :" + e);
// Log.e(TAG, "Bad NMEA sentence for geoid altitude - " + nmeaSentence + " :" + e);
return null;
}
if (!TextUtils.isEmpty(altitude)) {
Double altitudeParsed = null;
try {
altitudeParsed = Double.parseDouble(altitude);
} catch (NumberFormatException e) {
Log.e(TAG, "Bad geoid altitude value of '" + altitude + "' in NMEA sentence " + nmeaSentence + " :" + e);
// Log.e(TAG, "Bad geoid altitude value of '" + altitude + "' in NMEA sentence " + nmeaSentence + " :" + e);
}
return altitudeParsed;
} else {
Log.w(TAG, "Couldn't parse geoid altitude from NMEA: " + nmeaSentence);
// Log.w(TAG, "Couldn't parse geoid altitude from NMEA: " + nmeaSentence);
return null;
}
} else {
Log.w(TAG, "Input must be $GPGGA, $GNGNS, or $GNGGA NMEA: " + nmeaSentence);
// Log.w(TAG, "Input must be $GPGGA, $GNGNS, or $GNGGA NMEA: " + nmeaSentence);
return null;
}
}
Expand Down Expand Up @@ -100,7 +100,7 @@ public static DilutionOfPrecision getDop(String nmeaSentence) {
hdop = tokens[HDOP_INDEX];
vdop = tokens[VDOP_INDEX];
} catch (ArrayIndexOutOfBoundsException e) {
Log.e(TAG, "Bad NMEA message for parsing DOP - " + nmeaSentence + " :" + e);
// Log.e(TAG, "Bad NMEA message for parsing DOP - " + nmeaSentence + " :" + e);
return null;
}

Expand All @@ -116,15 +116,15 @@ public static DilutionOfPrecision getDop(String nmeaSentence) {
Double.valueOf(vdop));
} catch (NumberFormatException e) {
// See https://github.com/barbeau/gpstest/issues/71#issuecomment-263169174
Log.e(TAG, "Invalid DOP values in NMEA: " + nmeaSentence);
// Log.e(TAG, "Invalid DOP values in NMEA: " + nmeaSentence);
}
return dop;
} else {
Log.w(TAG, "Empty DOP values in NMEA: " + nmeaSentence);
// Log.w(TAG, "Empty DOP values in NMEA: " + nmeaSentence);
return null;
}
} else {
Log.w(TAG, "Input must be a $GNGSA NMEA: " + nmeaSentence);
// Log.w(TAG, "Input must be a $GNGSA NMEA: " + nmeaSentence);
return null;
}
}
Expand Down

0 comments on commit e97839e

Please sign in to comment.