From 774865dc7fcea52c4930866d7f33ead133c54607 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 15 Nov 2015 22:27:34 +0100 Subject: [PATCH] Update poi uploading --- .../controllers/EditPOIMenuController.java | 6 +- .../plus/osmedit/DashOsmEditsFragment.java | 4 +- .../plus/osmedit/EditPoiDialogFragment.java | 21 +++---- .../plus/osmedit/OpenstreetmapLocalUtil.java | 10 +--- .../plus/osmedit/OpenstreetmapRemoteUtil.java | 58 +++++++++++-------- .../plus/osmedit/OpenstreetmapUtil.java | 2 +- .../net/osmand/plus/osmedit/OsmBugsLayer.java | 4 +- .../osmand/plus/osmedit/OsmEditingPlugin.java | 41 +++++++++++-- .../osmand/plus/osmedit/OsmEditsFragment.java | 7 +-- .../osmedit/OsmEditsUploadListenerHelper.java | 5 +- .../plus/osmedit/UploadGPXFilesTask.java | 3 +- .../UploadOpenstreetmapPointAsyncTask.java | 6 +- 12 files changed, 91 insertions(+), 76 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/EditPOIMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/EditPOIMenuController.java index 15b7fca715..36015bc70f 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/EditPOIMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/EditPOIMenuController.java @@ -12,9 +12,7 @@ import net.osmand.plus.activities.MapActivity; import net.osmand.plus.mapcontextmenu.MenuController; import net.osmand.plus.mapcontextmenu.builders.EditPOIMenuBuilder; import net.osmand.plus.osmedit.OpenstreetmapPoint; -import net.osmand.plus.osmedit.OpenstreetmapRemoteUtil; import net.osmand.plus.osmedit.OsmBugsLayer; -import net.osmand.plus.osmedit.OsmBugsRemoteUtil; import net.osmand.plus.osmedit.OsmEditingPlugin; import net.osmand.plus.osmedit.OsmEditsUploadListener; import net.osmand.plus.osmedit.OsmEditsUploadListenerHelper; @@ -62,10 +60,8 @@ public class EditPOIMenuController extends MenuController { } } }; - OpenstreetmapRemoteUtil remotepoi = new OpenstreetmapRemoteUtil(getMapActivity()); - OsmBugsRemoteUtil remotebug = new OsmBugsRemoteUtil(getMapActivity().getMyApplication()); UploadOpenstreetmapPointAsyncTask uploadTask = new UploadOpenstreetmapPointAsyncTask( - dialog, listener, plugin, remotepoi, remotebug, points.length, closeChangeSet); + dialog, listener, plugin, points.length, closeChangeSet); uploadTask.execute(points); dialog.show(); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/DashOsmEditsFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/DashOsmEditsFragment.java index 4847d97b64..be8dcf6be9 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/DashOsmEditsFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/DashOsmEditsFragment.java @@ -152,9 +152,7 @@ public class DashOsmEditsFragment extends DashBaseFragment } public void showProgressDialog(OsmPoint[] points, boolean closeChangeSet) { - OpenstreetmapRemoteUtil remotepoi = new OpenstreetmapRemoteUtil(getActivity()); OsmPoint[] toUpload = points; - OsmBugsRemoteUtil remotebug = new OsmBugsRemoteUtil(getMyApplication()); ProgressDialog dialog = ProgressImplementation.createProgressDialog(getActivity(), getString(R.string.uploading), getString(R.string.local_openstreetmap_uploading), ProgressDialog.STYLE_HORIZONTAL).getDialog(); @@ -177,7 +175,7 @@ public class DashOsmEditsFragment extends DashBaseFragment } }; UploadOpenstreetmapPointAsyncTask uploadTask = new UploadOpenstreetmapPointAsyncTask(dialog, - listener, plugin, remotepoi, remotebug, toUpload.length, closeChangeSet); + listener, plugin, toUpload.length, closeChangeSet); uploadTask.execute(toUpload); dialog.show(); } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java index f2e5f955da..bd91908a80 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java @@ -104,9 +104,9 @@ public class EditPoiDialogFragment extends DialogFragment { OsmandSettings settings = getMyApplication().getSettings(); OsmEditingPlugin plugin = OsmandPlugin.getPlugin(OsmEditingPlugin.class); if (settings.OFFLINE_EDITION.get() || !settings.isInternetConnectionAvailable(true)) { - mOpenstreetmapUtil = new OpenstreetmapLocalUtil(plugin, activity); + mOpenstreetmapUtil = plugin.getPoiModificationLocalUtil(); } else { - mOpenstreetmapUtil = new OpenstreetmapRemoteUtil(activity); + mOpenstreetmapUtil = plugin.getPoiModificationRemoteUtil(); } Node node = (Node) getArguments().getSerializable(KEY_AMENITY_NODE); @@ -327,7 +327,7 @@ public class EditPoiDialogFragment extends DialogFragment { node.putTag(tag.getKey(), tag.getValue()); } } - commitNode(action, node, mOpenstreetmapUtil.getEntityInfo(), + commitNode(action, node, mOpenstreetmapUtil.getEntityInfo(node.getId()), "", false, new Runnable() { @@ -403,7 +403,6 @@ public class EditPoiDialogFragment extends DialogFragment { final Activity activity, final OpenstreetmapUtil openstreetmapUtil) { if (info == null && OsmPoint.Action.CREATE != action) { - AccessibleToast.makeText(activity, activity.getResources().getString(R.string.poi_error_info_not_loaded), Toast.LENGTH_LONG).show(); return; } @@ -537,12 +536,12 @@ public class EditPoiDialogFragment extends DialogFragment { final OsmandSettings settings = ((OsmandApplication) activity.getApplication()) .getSettings(); final OpenstreetmapUtil openstreetmapUtilToLoad; + OsmEditingPlugin plugin = OsmandPlugin.getPlugin(OsmEditingPlugin.class); if (//settings.OFFLINE_EDITION.get() || !settings.isInternetConnectionAvailable(true)) { - OsmEditingPlugin plugin = OsmandPlugin.getPlugin(OsmEditingPlugin.class); - openstreetmapUtilToLoad = new OpenstreetmapLocalUtil(plugin, activity); + openstreetmapUtilToLoad = plugin.getPoiModificationLocalUtil(); } else { - openstreetmapUtilToLoad = new OpenstreetmapRemoteUtil(activity); + openstreetmapUtilToLoad = plugin.getPoiModificationRemoteUtil(); } new AsyncTask() { @Override @@ -599,11 +598,9 @@ public class EditPoiDialogFragment extends DialogFragment { OsmandSettings settings = ((OsmandApplication) activity.getApplication()).getSettings(); OsmEditingPlugin plugin = OsmandPlugin.getPlugin(OsmEditingPlugin.class); if (settings.OFFLINE_EDITION.get() || !settings.isInternetConnectionAvailable(true)) { - openstreetmapUtil = new OpenstreetmapLocalUtil(plugin, activity); - } else if (!settings.isInternetConnectionAvailable(true)) { - openstreetmapUtil = new OpenstreetmapLocalUtil(plugin, activity); + openstreetmapUtil = plugin.getPoiModificationLocalUtil(); } else { - openstreetmapUtil = new OpenstreetmapRemoteUtil(activity); + openstreetmapUtil = plugin.getPoiModificationRemoteUtil(); } } @@ -643,7 +640,7 @@ public class EditPoiDialogFragment extends DialogFragment { String c = comment == null ? null : comment.getText().toString(); boolean closeChangeSet = closeChangesetCheckBox != null && closeChangesetCheckBox.isChecked(); - commitNode(OsmPoint.Action.DELETE, n, openstreetmapUtil.getEntityInfo(), c, + commitNode(OsmPoint.Action.DELETE, n, openstreetmapUtil.getEntityInfo(n.getId()), c, closeChangeSet, new Runnable() { @Override public void run() { diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapLocalUtil.java b/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapLocalUtil.java index 15a058ad1b..f63a80b376 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapLocalUtil.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapLocalUtil.java @@ -1,6 +1,5 @@ package net.osmand.plus.osmedit; -import android.content.Context; import net.osmand.PlatformUtil; import net.osmand.data.Amenity; import net.osmand.osm.PoiType; @@ -13,21 +12,18 @@ import net.osmand.util.MapUtils; import org.apache.commons.logging.Log; public class OpenstreetmapLocalUtil implements OpenstreetmapUtil { - - private final Context ctx; public final static Log LOG = PlatformUtil.getLog(OpenstreetmapLocalUtil.class); private OsmEditingPlugin plugin; - public OpenstreetmapLocalUtil(OsmEditingPlugin plugin, Context uiContext) { + public OpenstreetmapLocalUtil(OsmEditingPlugin plugin) { this.plugin = plugin; - this.ctx = uiContext; } @Override - public EntityInfo getEntityInfo() { - return new EntityInfo(); + public EntityInfo getEntityInfo(long id) { + return null; } @Override diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java b/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java index 69e3258c97..0a65e268f9 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java @@ -1,8 +1,20 @@ package net.osmand.plus.osmedit; -import android.content.Context; -import android.util.Xml; -import android.widget.Toast; +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.text.MessageFormat; +import java.util.LinkedHashMap; +import java.util.Map; import net.osmand.PlatformUtil; import net.osmand.access.AccessibleToast; @@ -26,21 +38,8 @@ import org.apache.commons.logging.Log; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlSerializer; -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.StringWriter; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.text.MessageFormat; -import java.util.LinkedHashMap; -import java.util.Map; +import android.util.Xml; +import android.widget.Toast; public class OpenstreetmapRemoteUtil implements OpenstreetmapUtil { @@ -48,6 +47,7 @@ public class OpenstreetmapRemoteUtil implements OpenstreetmapUtil { private final OsmandApplication ctx; private EntityInfo entityInfo; + private EntityId entityInfoId; // reuse changeset private long changeSetId = NO_CHANGESET_ID; @@ -57,14 +57,18 @@ public class OpenstreetmapRemoteUtil implements OpenstreetmapUtil { private OsmandSettings settings; - public OpenstreetmapRemoteUtil(Context uiContext) { - this.ctx = ((OsmandApplication) uiContext.getApplicationContext()); + + public OpenstreetmapRemoteUtil(OsmandApplication app) { + this.ctx = app; settings = ctx.getSettings(); } @Override - public EntityInfo getEntityInfo() { - return entityInfo; + public EntityInfo getEntityInfo(long id) { + if(entityInfoId != null && entityInfoId.getId().longValue() == id) { + return entityInfo; + } + return null; } private static String getSiteApi() { @@ -333,6 +337,7 @@ public class OpenstreetmapRemoteUtil implements OpenstreetmapUtil { n.setLongitude(entity.getLongitude()); } entityInfo = st.getRegisteredEntityInfo().get(id); + entityInfoId = id; return entityInfo; } @@ -360,11 +365,16 @@ public class OpenstreetmapRemoteUtil implements OpenstreetmapUtil { EntityId id = new Entity.EntityId(EntityType.NODE, nodeId); Node entity = (Node) st.getRegisteredEntities().get(id); entityInfo = st.getRegisteredEntityInfo().get(id); + entityInfoId = id; // check whether this is node (because id of node could be the same as relation) if (entity != null && MapUtils.getDistance(entity.getLatLon(), n.getLocation()) < 50) { PoiType poiType = n.getType().getPoiTypeByKeyName(n.getSubType()); - entity.removeTag(poiType.getOsmTag()); - entity.putTag(EditPoiData.POI_TYPE_TAG, poiType.getTranslation()); + if(poiType.getOsmValue().equals(entity.getTag(poiType.getOsmTag()))) { + entity.removeTag(poiType.getOsmTag()); + entity.putTag(EditPoiData.POI_TYPE_TAG, poiType.getTranslation()); + } else { + // later we could try to determine tags + } return entity; } return null; diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapUtil.java b/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapUtil.java index 5f212a00a9..5e092d438b 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapUtil.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapUtil.java @@ -6,7 +6,7 @@ import net.osmand.osm.edit.Node; public interface OpenstreetmapUtil { - public EntityInfo getEntityInfo(); + public EntityInfo getEntityInfo(long id); public Node commitNodeImpl(OsmPoint.Action action, Node n, EntityInfo info, String comment, boolean closeChangeSet); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java index b8012c26c7..d3d3c64dad 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java @@ -69,14 +69,12 @@ public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider private static final int DIALOG_BUG = 305; private static Bundle dialogBundle = new Bundle(); private OsmBugsLocalUtil local; - private OsmBugsRemoteUtil remote; private MapLayerData> data; public OsmBugsLayer(MapActivity activity, OsmEditingPlugin plugin){ this.activity = activity; this.plugin = plugin; local = new OsmBugsLocalUtil(activity, plugin.getDBBug()); - remote = new OsmBugsRemoteUtil(activity.getMyApplication()); } public OsmBugsUtil getOsmbugsUtil(OpenStreetNote bug) { @@ -85,7 +83,7 @@ public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider || !settings.isInternetConnectionAvailable(true)) { return local; } else { - return remote; + return plugin.getOsmNotesRemoteUtil(); } } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java index 7beb2d2503..390b3db93a 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java @@ -13,7 +13,6 @@ import android.widget.ArrayAdapter; import android.widget.EditText; import android.widget.Spinner; import android.widget.Toast; - import net.osmand.PlatformUtil; import net.osmand.access.AccessibleToast; import net.osmand.data.Amenity; @@ -33,6 +32,7 @@ import net.osmand.plus.dashboard.tools.DashFragmentData; import net.osmand.plus.myplaces.AvailableGPXFragment; import net.osmand.plus.myplaces.AvailableGPXFragment.GpxInfo; import net.osmand.plus.myplaces.FavoritesActivity; +import net.osmand.plus.osmedit.OsmPoint.Action; import net.osmand.plus.views.OsmandMapTileView; import net.osmand.util.Algorithms; @@ -48,6 +48,14 @@ public class OsmEditingPlugin extends OsmandPlugin { private OsmandApplication app; OpenstreetmapsDbHelper dbpoi; OsmBugsDbHelper dbbug; + OpenstreetmapLocalUtil localUtil; + OpenstreetmapRemoteUtil remoteUtil; + private OsmBugsRemoteUtil remoteNotesUtil; + + public OsmEditingPlugin(OsmandApplication app) { + this.app = app; + settings = app.getSettings(); + } @Override public String getId() { @@ -60,6 +68,30 @@ public class OsmEditingPlugin extends OsmandPlugin { } return dbpoi; } + + public OpenstreetmapLocalUtil getPoiModificationLocalUtil() { + if(localUtil == null) { + localUtil = new OpenstreetmapLocalUtil(this); + } + return localUtil; + } + + public OpenstreetmapRemoteUtil getPoiModificationRemoteUtil() { + if(remoteUtil == null) { + remoteUtil = new OpenstreetmapRemoteUtil(app); + } + return remoteUtil; + } + + public OsmBugsRemoteUtil getOsmNotesRemoteUtil() { + if(remoteNotesUtil == null) { + remoteNotesUtil = new OsmBugsRemoteUtil(app); + } + return remoteNotesUtil; + } + + + public OsmBugsDbHelper getDBBug() { if (dbbug == null) { @@ -68,10 +100,7 @@ public class OsmEditingPlugin extends OsmandPlugin { return dbbug; } - public OsmEditingPlugin(OsmandApplication app) { - this.app = app; - settings = app.getSettings(); - } + private OsmBugsLayer osmBugsLayer; private OsmEditsLayer osmEditsLayer; @@ -180,7 +209,7 @@ public class OsmEditingPlugin extends OsmandPlugin { if (isEditable) { adapter.item(R.string.poi_context_menu_modify).iconColor(R.drawable.ic_action_edit_dark).listen(listener).position(1).reg(); adapter.item(R.string.poi_context_menu_delete).iconColor(R.drawable.ic_action_delete_dark).listen(listener).position(2).reg(); - } else if (selectedObj instanceof OpenstreetmapPoint) { + } else if (selectedObj instanceof OpenstreetmapPoint && ((OpenstreetmapPoint) selectedObj).getAction() != Action.DELETE) { adapter.item(R.string.poi_context_menu_modify_osm_change) .iconColor(R.drawable.ic_action_edit_dark).listen(listener).position(1).reg(); } else { diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java index 2cbb1df1a0..47ca439f35 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java @@ -63,8 +63,6 @@ public class OsmEditsFragment extends OsmAndListFragment private boolean selectionMode = false; - private OpenstreetmapRemoteUtil remotepoi; - private OsmBugsRemoteUtil remotebug; private final static int MODE_DELETE = 100; private final static int MODE_UPLOAD = 101; @@ -81,9 +79,6 @@ public class OsmEditsFragment extends OsmAndListFragment View view = getActivity().getLayoutInflater().inflate(R.layout.update_index, container, false); ((TextView) view.findViewById(R.id.header)).setText(R.string.your_edits); - remotepoi = new OpenstreetmapRemoteUtil(getActivity()); - remotebug = new OsmBugsRemoteUtil(getMyApplication()); - final CheckBox selectAll = (CheckBox) view.findViewById(R.id.select_all); selectAll.setVisibility(View.GONE); selectAll.setOnClickListener(new View.OnClickListener() { @@ -535,7 +530,7 @@ public class OsmEditsFragment extends OsmAndListFragment } }; UploadOpenstreetmapPointAsyncTask uploadTask = new UploadOpenstreetmapPointAsyncTask( - dialog, listener, plugin, remotepoi, remotebug, points.length, closeChangeSet); + dialog, listener, plugin, points.length, closeChangeSet); uploadTask.execute(points); dialog.show(); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsUploadListenerHelper.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsUploadListenerHelper.java index 6346f17375..286ae30e17 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsUploadListenerHelper.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsUploadListenerHelper.java @@ -81,9 +81,6 @@ public class OsmEditsUploadListenerHelper implements OsmEditsUploadListener { private static void showUploadItemsProgressDialog(Fragment fragment, OsmPoint[] toUpload) { FragmentActivity activity = fragment.getActivity(); OsmEditingPlugin plugin = OsmandPlugin.getEnabledPlugin(OsmEditingPlugin.class); - OpenstreetmapRemoteUtil remotepoi = new OpenstreetmapRemoteUtil(activity); - OsmBugsRemoteUtil remotebug = new OsmBugsRemoteUtil((OsmandApplication) activity.getApplication()); - OsmEditsUploadListenerHelper helper = new OsmEditsUploadListenerHelper(activity, activity.getResources().getString(R.string.local_openstreetmap_were_uploaded)); @@ -94,7 +91,7 @@ public class OsmEditsUploadListenerHelper implements OsmEditsUploadListener { resources.getString(R.string.local_openstreetmap_uploading), ProgressDialog.STYLE_HORIZONTAL).getDialog(); UploadOpenstreetmapPointAsyncTask uploadTask = new UploadOpenstreetmapPointAsyncTask( - dialog, helper, plugin, remotepoi, remotebug, toUpload.length, false); + dialog, helper, plugin, toUpload.length, false); uploadTask.execute(toUpload); dialog.show(); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/UploadGPXFilesTask.java b/OsmAnd/src/net/osmand/plus/osmedit/UploadGPXFilesTask.java index 0dfcd0c60b..60bb7a7dc4 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/UploadGPXFilesTask.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/UploadGPXFilesTask.java @@ -3,6 +3,7 @@ package net.osmand.plus.osmedit; import java.io.File; import net.osmand.access.AccessibleToast; +import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.myplaces.AvailableGPXFragment.GpxInfo; import net.osmand.plus.osmedit.OsmEditingPlugin.UploadVisibility; @@ -34,7 +35,7 @@ public class UploadGPXFilesTask extends AsyncTask { if (!isCancelled() && info.file != null) { String warning = null; File file = info.file; - warning = new OpenstreetmapRemoteUtil(la).uploadGPXFile(tagstring, description, visibility, + warning = new OpenstreetmapRemoteUtil((OsmandApplication) la.getApplication()).uploadGPXFile(tagstring, description, visibility, file); total++; if (warning == null) { diff --git a/OsmAnd/src/net/osmand/plus/osmedit/UploadOpenstreetmapPointAsyncTask.java b/OsmAnd/src/net/osmand/plus/osmedit/UploadOpenstreetmapPointAsyncTask.java index dd19d6987a..a3d5b56d25 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/UploadOpenstreetmapPointAsyncTask.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/UploadOpenstreetmapPointAsyncTask.java @@ -26,14 +26,12 @@ public class UploadOpenstreetmapPointAsyncTask public UploadOpenstreetmapPointAsyncTask(ProgressDialog progress, OsmEditsUploadListener listener, OsmEditingPlugin plugin, - OpenstreetmapRemoteUtil remotepoi, - OsmBugsRemoteUtil remotebug, int listSize, boolean closeChangeSet) { this.progress = progress; this.plugin = plugin; - this.remotepoi = remotepoi; - this.remotebug = remotebug; + this.remotepoi = plugin.getPoiModificationRemoteUtil(); + this.remotebug = plugin.getOsmNotesRemoteUtil(); this.listSize = listSize; this.listener = listener; this.closeChangeSet = closeChangeSet;