Photo permission fix
This commit is contained in:
parent
439e4663e4
commit
fa0fab9ac7
1 changed files with 8 additions and 12 deletions
|
@ -1016,19 +1016,15 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void takePhoto(final double lat, final double lon, final MapActivity mapActivity) {
|
public void takePhoto(final double lat, final double lon, final MapActivity mapActivity) {
|
||||||
if (AV_EXTERNAL_PHOTO_CAM.get()) {
|
if (ActivityCompat.checkSelfPermission(mapActivity, Manifest.permission.CAMERA)
|
||||||
takePhotoExternal(lat, lon, mapActivity);
|
== PackageManager.PERMISSION_GRANTED) {
|
||||||
|
takePhotoInternalOrExternal(lat, lon, mapActivity);
|
||||||
} else {
|
} else {
|
||||||
if (ActivityCompat.checkSelfPermission(mapActivity, Manifest.permission.CAMERA)
|
actionLat = lat;
|
||||||
== PackageManager.PERMISSION_GRANTED) {
|
actionLon = lon;
|
||||||
takePhotoInternalOrExternal(lat, lon, mapActivity);
|
ActivityCompat.requestPermissions(mapActivity,
|
||||||
} else {
|
new String[]{Manifest.permission.CAMERA},
|
||||||
actionLat = lat;
|
CAMERA_FOR_PHOTO_REQUEST_CODE);
|
||||||
actionLon = lon;
|
|
||||||
ActivityCompat.requestPermissions(mapActivity,
|
|
||||||
new String[]{Manifest.permission.CAMERA},
|
|
||||||
CAMERA_FOR_PHOTO_REQUEST_CODE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue