Skip to content

Commit

Permalink
1. Added log if no permission is granted for location.
Browse files Browse the repository at this point in the history
  • Loading branch information
amitjangid80 committed May 14, 2018
1 parent 1bb1faf commit b458b7e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/src/main/java/com/amit/location/MyLocation.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public void onLocationChanged(Location location)
ActivityCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_COARSE_LOCATION)
!= PackageManager.PERMISSION_GRANTED)
{
Log.e(TAG, "onLocationChanged: permission to access location is not granted.");
return;
}

Expand Down Expand Up @@ -142,6 +143,7 @@ public boolean getLocation(Context context, LocationResult result)
ActivityCompat.checkSelfPermission(this.mContext, Manifest.permission.ACCESS_COARSE_LOCATION)
!= PackageManager.PERMISSION_GRANTED)
{
Log.e(TAG, "onLocationChanged: permission to access location is not granted.");
return false;
}

Expand Down Expand Up @@ -177,6 +179,7 @@ public void run()
ActivityCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_COARSE_LOCATION)
!= PackageManager.PERMISSION_GRANTED)
{
Log.e(TAG, "onLocationChanged: permission to access location is not granted.");
return;
}

Expand Down

0 comments on commit b458b7e

Please sign in to comment.