Merge "Removing config shortcut activities for managed profiles for apps build with older sdk" into ub-launcher3-dorval

am: aeb60bffc9

Change-Id: I9570796d6ef999c346ac856b997c13685b51ac39
This commit is contained in:
Sunny Goyal authored and android-build-merger committed 2017-03-20 22:25:15 +00:00
commit bf4327520c
4 files changed
+22 -3

No files matched your search

+7 -2
View File
@@ -1451,9 +1451,14 @@ public class Launcher extends BaseActivity
}
if (info == null) {
info = InstallShortcutReceiver.fromShortcutIntent(this, data);
// Legacy shortcuts are only supported for primary profile.
info = Process.myUserHandle().equals(args.user)
? InstallShortcutReceiver.fromShortcutIntent(this, data) : null;
if (info == null || !new PackageManagerHelper(this).hasPermissionForActivity(
if (info == null) {
Log.e(TAG, "Unable to parse a valid custom shortcut result");
return;
} else if (!new PackageManagerHelper(this).hasPermissionForActivity(
info.intent, args.getPendingIntent().getComponent().getPackageName())) {
// The app is trying to add a shortcut without sufficient permissions
Log.e(TAG, "Ignoring malicious intent " + info.intent.toUri(0));