From fa0fab9ac78796ca96c526fa64b624ed36719875 Mon Sep 17 00:00:00 2001 From: GaidamakUA Date: Mon, 14 Dec 2015 16:22:06 +0200 Subject: [PATCH] Photo permission fix --- .../audionotes/AudioVideoNotesPlugin.java | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java index 9527b1398d..89335a8243 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java @@ -1016,19 +1016,15 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { } public void takePhoto(final double lat, final double lon, final MapActivity mapActivity) { - if (AV_EXTERNAL_PHOTO_CAM.get()) { - takePhotoExternal(lat, lon, mapActivity); + if (ActivityCompat.checkSelfPermission(mapActivity, Manifest.permission.CAMERA) + == PackageManager.PERMISSION_GRANTED) { + takePhotoInternalOrExternal(lat, lon, mapActivity); } else { - if (ActivityCompat.checkSelfPermission(mapActivity, Manifest.permission.CAMERA) - == PackageManager.PERMISSION_GRANTED) { - takePhotoInternalOrExternal(lat, lon, mapActivity); - } else { - actionLat = lat; - actionLon = lon; - ActivityCompat.requestPermissions(mapActivity, - new String[]{Manifest.permission.CAMERA}, - CAMERA_FOR_PHOTO_REQUEST_CODE); - } + actionLat = lat; + actionLon = lon; + ActivityCompat.requestPermissions(mapActivity, + new String[]{Manifest.permission.CAMERA}, + CAMERA_FOR_PHOTO_REQUEST_CODE); } }