Skip to content

Commit b458b7e

Browse files
committed
1. Added log if no permission is granted for location.
1 parent 1bb1faf commit b458b7e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/src/main/java/com/amit/location/MyLocation.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public void onLocationChanged(Location location)
7676
ActivityCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_COARSE_LOCATION)
7777
!= PackageManager.PERMISSION_GRANTED)
7878
{
79+
Log.e(TAG, "onLocationChanged: permission to access location is not granted.");
7980
return;
8081
}
8182

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

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

0 commit comments

Comments
 (0)