Skip to content

Commit

Permalink
fix:android:Add possibility to use background position usage
Browse files Browse the repository at this point in the history
  • Loading branch information
jkoan committed Nov 17, 2020
1 parent 11b5f77 commit 310570b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions navit/android/src/org/navitproject/navit/Navit.java
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,15 @@ public void onClick(DialogInterface arg0, int arg1) {

private void verifyPermissions() {
if (ContextCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
return;
} else if (ContextCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_BACKGROUND_LOCATION) == PackageManager.PERMISSION_GRANTED) {
return;
} else {
Log.d(TAG,"ask for permission(s)");
ActivityCompat.requestPermissions(this, new String[] {
Manifest.permission.ACCESS_FINE_LOCATION}, MY_PERMISSIONS_REQ_FINE_LOC);
Manifest.permission.ACCESS_BACKGROUND_LOCATION}, MY_PERMISSIONS_REQ_FINE_LOC);
}
}

Expand Down

0 comments on commit 310570b

Please sign in to comment.