forked from upstream-mirrors/OpenTracks
remove useless parameter
This commit is contained in:
@@ -208,8 +208,7 @@ public class ShareContentProvider extends CustomContentProvider implements ICont
|
|||||||
tracks[i] = contentProviderUtils.getTrack(trackIds[i]);
|
tracks[i] = contentProviderUtils.getTrack(trackIds[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean hasMultipleTracks = tracks.length > 1;
|
final TrackExporter trackExporter = getTrackFileFormat(uri).newTrackExporter(getContext());
|
||||||
final TrackExporter trackExporter = getTrackFileFormat(uri).newTrackExporter(getContext(), hasMultipleTracks);
|
|
||||||
|
|
||||||
PipeDataWriter<String> pipeDataWriter = (output, uri1, mimeType, opts, args) -> {
|
PipeDataWriter<String> pipeDataWriter = (output, uri1, mimeType, opts, args) -> {
|
||||||
try (FileOutputStream fileOutputStream = new FileOutputStream(output.getFileDescriptor())) {
|
try (FileOutputStream fileOutputStream = new FileOutputStream(output.getFileDescriptor())) {
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import android.content.Context;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import de.dennisguse.opentracks.R;
|
import de.dennisguse.opentracks.R;
|
||||||
import de.dennisguse.opentracks.content.data.Track;
|
|
||||||
import de.dennisguse.opentracks.content.provider.ContentProviderUtils;
|
import de.dennisguse.opentracks.content.provider.ContentProviderUtils;
|
||||||
import de.dennisguse.opentracks.io.file.exporter.FileTrackExporter;
|
import de.dennisguse.opentracks.io.file.exporter.FileTrackExporter;
|
||||||
import de.dennisguse.opentracks.io.file.exporter.GpxTrackWriter;
|
import de.dennisguse.opentracks.io.file.exporter.GpxTrackWriter;
|
||||||
@@ -21,8 +20,8 @@ public enum TrackFileFormat {
|
|||||||
|
|
||||||
KML_ONLY_TRACK {
|
KML_ONLY_TRACK {
|
||||||
@Override
|
@Override
|
||||||
public TrackWriter newTrackWriter(Context context, boolean hasMultipleTracks) {
|
public TrackWriter newTrackWriter(Context context) {
|
||||||
return new KmlTrackWriter(context,false, false, false);
|
return new KmlTrackWriter(context, false, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -36,8 +35,8 @@ public enum TrackFileFormat {
|
|||||||
},
|
},
|
||||||
KML_WITH_TRACKDETAIL {
|
KML_WITH_TRACKDETAIL {
|
||||||
@Override
|
@Override
|
||||||
public TrackWriter newTrackWriter(Context context, boolean hasMultipleTracks) {
|
public TrackWriter newTrackWriter(Context context) {
|
||||||
return new KmlTrackWriter(context,true, false, false);
|
return new KmlTrackWriter(context, true, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -51,8 +50,8 @@ public enum TrackFileFormat {
|
|||||||
},
|
},
|
||||||
KML_WITH_TRACKDETAIL_AND_SENSORDATA {
|
KML_WITH_TRACKDETAIL_AND_SENSORDATA {
|
||||||
@Override
|
@Override
|
||||||
public TrackWriter newTrackWriter(Context context, boolean hasMultipleTracks) {
|
public TrackWriter newTrackWriter(Context context) {
|
||||||
return new KmlTrackWriter(context,true, true, false);
|
return new KmlTrackWriter(context, true, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -69,12 +68,12 @@ public enum TrackFileFormat {
|
|||||||
private static final boolean exportPhotos = false;
|
private static final boolean exportPhotos = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TrackWriter newTrackWriter(Context context, boolean hasMultipleTracks) {
|
public TrackWriter newTrackWriter(Context context) {
|
||||||
return new KmlTrackWriter(context,false, false, exportPhotos);
|
return new KmlTrackWriter(context, false, false, exportPhotos);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TrackExporter newTrackExporter(Context context, boolean hasMultipleTracks) {
|
public TrackExporter newTrackExporter(Context context) {
|
||||||
return newKmzTrackExporter(context, this.newTrackWriter(context, hasMultipleTracks), exportPhotos);
|
return newKmzTrackExporter(context, this.newTrackWriter(context), exportPhotos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -96,12 +95,12 @@ public enum TrackFileFormat {
|
|||||||
private static final boolean exportPhotos = false;
|
private static final boolean exportPhotos = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TrackWriter newTrackWriter(Context context, boolean hasMultipleTracks) {
|
public TrackWriter newTrackWriter(Context context) {
|
||||||
return new KmlTrackWriter(context,true, false, exportPhotos);
|
return new KmlTrackWriter(context, true, false, exportPhotos);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TrackExporter newTrackExporter(Context context, boolean hasMultipleTracks) {
|
public TrackExporter newTrackExporter(Context context) {
|
||||||
return newKmzTrackExporter(context, this.newTrackWriter(context, hasMultipleTracks), exportPhotos);
|
return newKmzTrackExporter(context, this.newTrackWriter(context), exportPhotos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -124,8 +123,8 @@ public enum TrackFileFormat {
|
|||||||
private static final boolean exportPhotos = false;
|
private static final boolean exportPhotos = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TrackWriter newTrackWriter(Context context, boolean hasMultipleTracks) {
|
public TrackWriter newTrackWriter(Context context) {
|
||||||
return new KmlTrackWriter(context,true, true, exportPhotos);
|
return new KmlTrackWriter(context, true, true, exportPhotos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -133,8 +132,8 @@ public enum TrackFileFormat {
|
|||||||
return MIME_KMZ;
|
return MIME_KMZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TrackExporter newTrackExporter(Context context, boolean hasMultipleTracks) {
|
public TrackExporter newTrackExporter(Context context) {
|
||||||
return newKmzTrackExporter(context, this.newTrackWriter(context, hasMultipleTracks), exportPhotos);
|
return newKmzTrackExporter(context, this.newTrackWriter(context), exportPhotos);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getExtension() {
|
public String getExtension() {
|
||||||
@@ -153,8 +152,8 @@ public enum TrackFileFormat {
|
|||||||
private static final boolean exportPhotos = true;
|
private static final boolean exportPhotos = true;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TrackWriter newTrackWriter(Context context, boolean hasMultipleTracks) {
|
public TrackWriter newTrackWriter(Context context) {
|
||||||
return new KmlTrackWriter(context,true, true, exportPhotos);
|
return new KmlTrackWriter(context, true, true, exportPhotos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -162,8 +161,8 @@ public enum TrackFileFormat {
|
|||||||
return MIME_KMZ;
|
return MIME_KMZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TrackExporter newTrackExporter(Context context, boolean hasMultipleTracks) {
|
public TrackExporter newTrackExporter(Context context) {
|
||||||
return newKmzTrackExporter(context, newTrackWriter(context, hasMultipleTracks), exportPhotos);
|
return newKmzTrackExporter(context, newTrackWriter(context), exportPhotos);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getExtension() {
|
public String getExtension() {
|
||||||
@@ -178,7 +177,7 @@ public enum TrackFileFormat {
|
|||||||
},
|
},
|
||||||
GPX {
|
GPX {
|
||||||
@Override
|
@Override
|
||||||
public TrackWriter newTrackWriter(Context context, boolean hasMultipleTracks) {
|
public TrackWriter newTrackWriter(Context context) {
|
||||||
return new GpxTrackWriter(context.getString(R.string.app_name));
|
return new GpxTrackWriter(context.getString(R.string.app_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -210,22 +209,17 @@ public enum TrackFileFormat {
|
|||||||
public abstract String getMimeType();
|
public abstract String getMimeType();
|
||||||
|
|
||||||
public TrackExporter newTrackExporter(Context context) {
|
public TrackExporter newTrackExporter(Context context) {
|
||||||
return newTrackExporter(context, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public TrackExporter newTrackExporter(Context context, boolean hasMultipleTracks) {
|
|
||||||
ContentProviderUtils contentProviderUtils = new ContentProviderUtils(context);
|
ContentProviderUtils contentProviderUtils = new ContentProviderUtils(context);
|
||||||
TrackWriter trackWriter = newTrackWriter(context, hasMultipleTracks);
|
TrackWriter trackWriter = newTrackWriter(context);
|
||||||
return new FileTrackExporter(contentProviderUtils, trackWriter);
|
return new FileTrackExporter(contentProviderUtils, trackWriter);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new track writer for the format.
|
* Creates a new track writer for the format.
|
||||||
*
|
*
|
||||||
* @param context the context
|
* @param context the context
|
||||||
* @param multiple true for writing multiple tracks
|
|
||||||
*/
|
*/
|
||||||
public abstract TrackWriter newTrackWriter(Context context, boolean hasMultipleTracks);
|
public abstract TrackWriter newTrackWriter(Context context);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the file extension for each format.
|
* Returns the file extension for each format.
|
||||||
|
|||||||
Reference in New Issue
Block a user