Fix taking photo with aidl
This commit is contained in:
parent
d6d520dd4d
commit
3cdda4773f
4 changed files with 7 additions and 7 deletions
|
@ -391,7 +391,7 @@ public class OsmandAidlApi {
|
|||
if (plugin != null) {
|
||||
double lat = intent.getDoubleExtra(AIDL_LATITUDE, Double.NaN);
|
||||
double lon = intent.getDoubleExtra(AIDL_LONGITUDE, Double.NaN);
|
||||
plugin.takePhoto(lat, lon, mapActivity, false);
|
||||
plugin.takePhoto(lat, lon, mapActivity, false, true);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -651,7 +651,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
|
|||
.setListener(new ItemClickListener() {
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
||||
takePhoto(latitude, longitude, mapActivity, false);
|
||||
takePhoto(latitude, longitude, mapActivity, false, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -771,7 +771,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
|
|||
if (action == AV_DEFAULT_ACTION_VIDEO) {
|
||||
recordVideo(lat, lon, mapActivity);
|
||||
} else if (action == AV_DEFAULT_ACTION_TAKEPICTURE) {
|
||||
takePhoto(lat, lon, mapActivity, false);
|
||||
takePhoto(lat, lon, mapActivity, false, false);
|
||||
} else if (action == AV_DEFAULT_ACTION_AUDIO) {
|
||||
recordAudio(lat, lon, mapActivity);
|
||||
}
|
||||
|
@ -1192,10 +1192,10 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
|
|||
}
|
||||
|
||||
public void takePhoto(final double lat, final double lon, final MapActivity mapActivity,
|
||||
final boolean forceInternal) {
|
||||
final boolean forceInternal, final boolean forceExternal) {
|
||||
if (ActivityCompat.checkSelfPermission(mapActivity, Manifest.permission.CAMERA)
|
||||
== PackageManager.PERMISSION_GRANTED) {
|
||||
if (!AV_EXTERNAL_PHOTO_CAM.get() || forceInternal) {
|
||||
if ((!AV_EXTERNAL_PHOTO_CAM.get() || forceInternal) && !forceExternal) {
|
||||
takePhotoInternalOrExternal(lat, lon, mapActivity);
|
||||
} else {
|
||||
takePhotoExternal(lat, lon, mapActivity);
|
||||
|
|
|
@ -31,7 +31,7 @@ public class TakePhotoNoteAction extends QuickAction {
|
|||
|
||||
AudioVideoNotesPlugin plugin = OsmandPlugin.getPlugin(AudioVideoNotesPlugin.class);
|
||||
if (plugin != null)
|
||||
plugin.takePhoto(latLon.getLatitude(), latLon.getLongitude(), activity, false);
|
||||
plugin.takePhoto(latLon.getLatitude(), latLon.getLongitude(), activity, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -287,7 +287,7 @@ public class ExternalApiHelper {
|
|||
} else if (API_CMD_RECORD_VIDEO.equals(cmd)) {
|
||||
plugin.recordVideo(lat, lon, mapActivity);
|
||||
} else if (API_CMD_RECORD_PHOTO.equals(cmd)) {
|
||||
plugin.takePhoto(lat, lon, mapActivity, true);
|
||||
plugin.takePhoto(lat, lon, mapActivity, true, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue