From 0659467a622160b0059a95e6925b13c16430044f Mon Sep 17 00:00:00 2001 From: Roman Tsisyk Date: Mon, 2 Aug 2021 09:02:05 +0300 Subject: [PATCH] [android] Add support for ACTION_SEND intents Signed-off-by: Roman Tsisyk --- android/AndroidManifest.xml | 12 ++++++++++++ android/src/com/mapswithme/maps/intent/Factory.java | 7 +++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 8b4a5c1c03..f5e5fa7939 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -171,6 +171,18 @@ android:mimeType="application/vnd.google-earth.kml+xml"/> + + + + + + + + + + + + diff --git a/android/src/com/mapswithme/maps/intent/Factory.java b/android/src/com/mapswithme/maps/intent/Factory.java index dca5811e77..95dba29699 100644 --- a/android/src/com/mapswithme/maps/intent/Factory.java +++ b/android/src/com/mapswithme/maps/intent/Factory.java @@ -39,7 +39,6 @@ import com.mapswithme.util.log.Logger; import com.mapswithme.util.log.LoggerFactory; import java.io.File; -import java.io.IOException; import java.util.List; import java.util.Locale; @@ -405,7 +404,11 @@ public class Factory @Override public boolean isSupported(@NonNull Intent intent) { - mData = intent.getData(); + // See KML/KMZ/KMB intent filters in manifest. + if (intent.getAction() == Intent.ACTION_VIEW) + mData = intent.getData(); + else if (intent.getAction() == Intent.ACTION_SEND) + mData = intent.getParcelableExtra(Intent.EXTRA_STREAM); return mData != null; }