forked from upstream-mirrors/OpenTracks
Fixed ShareContentProvider and KMZ mime type.
This commit is contained in:
@@ -74,6 +74,9 @@ public class ShareContentProvider extends CustomContentProvider implements ICont
|
||||
|
||||
Uri uri = Uri.parse(ContentProviderUtils.CONTENT_BASE_URI + "/" + TracksColumns.TABLE_NAME + "/" + trackFileFormat.getName() + "/" + builder + "." + trackFileFormat.getExtension());
|
||||
String mime = getTypeMime(uri);
|
||||
|
||||
Log.d(TAG, "Created uri " + uri.toString() + " with MIME " + mime);
|
||||
|
||||
return new Pair<>(uri, mime);
|
||||
}
|
||||
|
||||
@@ -137,7 +140,7 @@ public class ShareContentProvider extends CustomContentProvider implements ICont
|
||||
|
||||
@Override
|
||||
public Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable String selection, @Nullable String[] selectionArgs, @Nullable String sortOrder) {
|
||||
if (uriMatcher.match(uri) != URI_KML_ONLY) {
|
||||
if (uriMatcher.match(uri) == -1) {
|
||||
return super.query(uri, projection, selection, selectionArgs, sortOrder);
|
||||
}
|
||||
|
||||
|
||||
@@ -144,6 +144,8 @@ public enum TrackFileFormat implements Parcelable {
|
||||
dest.writeInt(ordinal());
|
||||
}
|
||||
|
||||
private static final String MIME_KMZ = "application/vnd.google-earth.kmz";
|
||||
|
||||
private static final String MIME_KML = "application/vnd.google-earth.kml+xml";
|
||||
|
||||
public TrackExporter newTrackExporter(Context context, Track[] tracks, TrackExporterListener trackExporterListener) {
|
||||
@@ -157,8 +159,6 @@ public enum TrackFileFormat implements Parcelable {
|
||||
*/
|
||||
public abstract String getMimeType();
|
||||
|
||||
private static final String MIME_KMZ = "application/vnd.google-earth.kml+xml";
|
||||
|
||||
private static TrackExporter newKmzTrackExporter(Context context, TrackWriter trackWriter, Track[] tracks, TrackExporterListener trackExporterListener) {
|
||||
ContentProviderUtils contentProviderUtils = ContentProviderUtils.Factory.get(context);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user