summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Launcher.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2017-03-20 13:57:28 -0700
committerSunny Goyal <sunnygoyal@google.com>2017-03-20 15:13:51 -0700
commitb57645fcdb87847edd216e71e3b08107027e0ed3 (patch)
treed79d20c8dc7c042a49283373798d8fd23a366291 /src/com/android/launcher3/Launcher.java
parentb00fcd4e49eae98304b98bde24804dc0dedcfbee (diff)
downloadandroid_packages_apps_Trebuchet-b57645fcdb87847edd216e71e3b08107027e0ed3.tar.gz
android_packages_apps_Trebuchet-b57645fcdb87847edd216e71e3b08107027e0ed3.tar.bz2
android_packages_apps_Trebuchet-b57645fcdb87847edd216e71e3b08107027e0ed3.zip
Removing config shortcut activities for managed profiles for
apps build with older sdk > Also fixing the bug where legacy icon with primary user gets created when managed user failed to provide the new icon Bug: 34392403 Change-Id: I1d56962e9520742781df6cbeb03be2b9767a8c0b
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r--src/com/android/launcher3/Launcher.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index b388d28d6..d4bfc4913 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -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));