Set exported to "false" again and include a fix for wrong PackageManager queries

This commit is contained in:
fkloft 2013-11-04 18:09:00 +01:00
parent 5817052cbd
commit b678d83afd
2 changed files with 9 additions and 1 deletions

View File

@ -100,7 +100,7 @@
android:name=".share.SendToClipboard" android:name=".share.SendToClipboard"
android:enabled="true" android:enabled="true"
android:excludeFromRecents="true" android:excludeFromRecents="true"
android:exported="true" android:exported="false"
android:icon="@drawable/copy" android:icon="@drawable/copy"
android:label="@string/activity_share_to_clipboard" android:label="@string/activity_share_to_clipboard"
android:noHistory="false"> android:noHistory="false">

View File

@ -152,11 +152,19 @@ public class IntentListView extends ListView {
ResolveInfo info = activityList.get(i); ResolveInfo info = activityList.get(i);
ActivityInfo activity = info.activityInfo; 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 // remove all IITCm intents, except for SendToClipboard in case Drive is not installed
if (activity.packageName.equals(packageName)) { if (activity.packageName.equals(packageName)) {
if (hasCopyIntent || !activity.name.equals(SendToClipboard.class.getCanonicalName())) { if (hasCopyIntent || !activity.name.equals(SendToClipboard.class.getCanonicalName())) {
activityList.remove(i); activityList.remove(i);
i--; i--;
continue;
} }
} }
} }