diff --git a/mobile/AndroidManifest.xml b/mobile/AndroidManifest.xml index f63e3dae..93066966 100644 --- a/mobile/AndroidManifest.xml +++ b/mobile/AndroidManifest.xml @@ -100,7 +100,7 @@ android:name=".share.SendToClipboard" android:enabled="true" android:excludeFromRecents="true" - android:exported="true" + android:exported="false" android:icon="@drawable/copy" android:label="@string/activity_share_to_clipboard" android:noHistory="false"> diff --git a/mobile/src/com/cradle/iitc_mobile/share/IntentListView.java b/mobile/src/com/cradle/iitc_mobile/share/IntentListView.java index 621f023c..235701bf 100644 --- a/mobile/src/com/cradle/iitc_mobile/share/IntentListView.java +++ b/mobile/src/com/cradle/iitc_mobile/share/IntentListView.java @@ -152,11 +152,19 @@ public class IntentListView extends ListView { ResolveInfo info = activityList.get(i); ActivityInfo activity = info.activityInfo; + // fix bug in PackageManager - a replaced package name might cause non-exported intents to appear + if (activity.exported == false && !activity.packageName.equals(packageName)) { + activityList.remove(i); + i--; + continue; + } + // remove all IITCm intents, except for SendToClipboard in case Drive is not installed if (activity.packageName.equals(packageName)) { if (hasCopyIntent || !activity.name.equals(SendToClipboard.class.getCanonicalName())) { activityList.remove(i); i--; + continue; } } }