Skip to content

Commit

Permalink
Remove log messages from FileComplaintFragment
Browse files Browse the repository at this point in the history
  • Loading branch information
pulsejet committed Feb 5, 2019
1 parent 80619fa commit 02a3803
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions app/src/main/java/app/insti/fragment/FileComplaintFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,6 @@ private void addTags(Tag tag) {
}

public void getMapReady() {

Log.i(TAG, "in getMapReady");
mMapView.getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(GoogleMap map) {
Expand All @@ -356,18 +354,15 @@ public void onMapReady(GoogleMap map) {
uiSettings.setScrollGesturesEnabled(true);
if (ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
&& ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
Log.i(TAG, "No initial permission granted");
ActivityCompat.requestPermissions(getActivity(),
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
MY_PERMISSIONS_REQUEST_LOCATION);
} else {
Log.i(TAG, "Initial Permission Granted");
googleMap.setMyLocationEnabled(true);
googleMap.getUiSettings().setMyLocationButtonEnabled(true);
googleMap.setOnMyLocationButtonClickListener(new GoogleMap.OnMyLocationButtonClickListener() {
@Override
public boolean onMyLocationButtonClick() {
Log.i(TAG, "in onMyLocationButtonClick");
locate();
return false;
}
Expand All @@ -379,7 +374,6 @@ public void onSuccess(Location location) {
// Got last known location. In some rare situations this can be null.
if (location != null) {
// Logic to handle location object
Log.i(TAG, "lat = " + location.getLatitude() + " lon = " + location.getLongitude());
Location = new LatLng(location.getLatitude(), location.getLongitude());
updateMap(Location, "Current Location", location.getLatitude() + ", " + location.getLongitude(), cursor);
} else {
Expand All @@ -400,12 +394,9 @@ public void onFailure(Exception e) {
}

private void locate() {
Log.i(TAG, "In locate");
if (!GPSIsSetup) {
Log.i(TAG, "GPS not enabled");
displayLocationSettingsRequest();
} else {
Log.i(TAG, "GPS enabled");
try {
FusedLocationProviderClient mFusedLocationClient = LocationServices.getFusedLocationProviderClient(getActivity());
mFusedLocationClient.getLastLocation().addOnSuccessListener(new OnSuccessListener<Location>() {
Expand All @@ -414,7 +405,6 @@ public void onSuccess(Location location) {
// Got last known location. In some rare situations this can be null.
if (location != null) {
// Logic to handle location object
Log.i(TAG, "lat = " + location.getLatitude() + " lon = " + location.getLongitude());
Location = new LatLng(location.getLatitude(), location.getLongitude());
updateMap(Location, "Current Location", location.getLatitude() + ", " + location.getLongitude(), cursor);
} else {
Expand All @@ -438,7 +428,6 @@ public void onFailure(Exception e) {
}

private void displayLocationSettingsRequest() {
Log.i(TAG, "In displayLocationSettingsRequest");
if (getView() == null || getActivity() == null) return;
LocationRequest mLocationRequest = LocationRequest.create()
.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY)
Expand All @@ -453,25 +442,21 @@ private void displayLocationSettingsRequest() {
@Override
public void onComplete(@NonNull Task<LocationSettingsResponse> task) {
try {
Log.i(TAG, "In displayLocationSettingsRequest try");
LocationSettingsResponse result = task.getResult(ApiException.class);
if (result.getLocationSettingsStates().isGpsPresent() &&
result.getLocationSettingsStates().isGpsUsable() &&
result.getLocationSettingsStates().isLocationPresent() &&
result.getLocationSettingsStates().isLocationUsable()) {
Log.i(TAG, "In displayLocationSettingsRequest if setupGPS called");
setupGPS();
}
} catch (ApiException ex) {
Log.i(TAG, "In displayLocationSettingsRequest catch");
switch (ex.getStatusCode()) {
case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:
try {
ResolvableApiException resolvableApiException =
(ResolvableApiException) ex;
resolvableApiException
.startResolutionForResult(getActivity(), 87);
Log.i(TAG, "In displayLocationSettingsRequest catch case1 try setupGPS called");
setupGPS();
} catch (IntentSender.SendIntentException e) {
}
Expand All @@ -489,7 +474,6 @@ public void onComplete(@NonNull Task<LocationSettingsResponse> task) {
}

private void setupGPS() {
Log.i(TAG, "In setup");
if (getView() == null || getActivity() == null) return;
// Permissions stuff
if (ContextCompat.checkSelfPermission(getActivity(),
Expand All @@ -507,7 +491,6 @@ public void onSuccess(Location location) {
// Got last known location. In some rare situations this can be null.
if (location != null) {
// Logic to handle location object
Log.i(TAG, "lat = " + location.getLatitude() + " lon = " + location.getLongitude());
Location = new LatLng(location.getLatitude(), location.getLongitude());
updateMap(Location, "Current Location", location.getLatitude() + ", " + location.getLongitude(), cursor);
} else {
Expand Down

0 comments on commit 02a3803

Please sign in to comment.