From 4ef7c41a0aa3b18921d9cd28c80d668c93fd20d4 Mon Sep 17 00:00:00 2001 From: fkloft Date: Sun, 23 Feb 2014 13:16:13 +0100 Subject: [PATCH] Ignore not exported activities --- .../src/com/cradle/iitc_mobile/share/IntentGenerator.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mobile/src/com/cradle/iitc_mobile/share/IntentGenerator.java b/mobile/src/com/cradle/iitc_mobile/share/IntentGenerator.java index 92992030..750d736b 100644 --- a/mobile/src/com/cradle/iitc_mobile/share/IntentGenerator.java +++ b/mobile/src/com/cradle/iitc_mobile/share/IntentGenerator.java @@ -73,9 +73,14 @@ public class IntentGenerator { final ActivityInfo activity = resolveInfo.activityInfo; final ComponentName component = new ComponentName(activity.packageName, activity.name); - // remove IITCm from list + // remove IITCm from list (we only want other apps) if (activity.packageName.equals(packageName)) continue; + // bug in package manager. not exported activities shouldn't even appear here + // (usually you would have to compare the package name as well, but since we ignore our own activities, + // this isn't necessary) + if (!activity.exported) continue; + final Intent targetIntent = new Intent(intent) .setComponent(component) .putExtra(EXTRA_FLAG_TITLE, activity.loadLabel(mPackageManager));