diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2017-03-21 15:12:01 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2017-03-21 15:14:43 -0700 |
commit | 24bb66a1c5a435ab0c55b4a97e788bdc2595bf84 (patch) | |
tree | 9adb87cf1377a5ccfce25f59e2295d4564a6c6c9 /src/com/android/launcher3/AppInfo.java | |
parent | aeb60bffc9a5a9a45bac59b189f9d448b1c63320 (diff) | |
download | android_packages_apps_Trebuchet-24bb66a1c5a435ab0c55b4a97e788bdc2595bf84.tar.gz android_packages_apps_Trebuchet-24bb66a1c5a435ab0c55b4a97e788bdc2595bf84.tar.bz2 android_packages_apps_Trebuchet-24bb66a1c5a435ab0c55b4a97e788bdc2595bf84.zip |
Removing the profile extra from intent and using the profile id from the profile column
The intent extra is not always correct as the profile id can change during backup restore.
This allows us to use a consistant behavior everywhere.
Change-Id: I004bd244204ca91758b1d42488e1fc13b0ccb998
Diffstat (limited to 'src/com/android/launcher3/AppInfo.java')
-rw-r--r-- | src/com/android/launcher3/AppInfo.java | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/com/android/launcher3/AppInfo.java b/src/com/android/launcher3/AppInfo.java index 2a620370f..9ec26e26a 100644 --- a/src/com/android/launcher3/AppInfo.java +++ b/src/com/android/launcher3/AppInfo.java @@ -56,11 +56,10 @@ public class AppInfo extends ItemInfoWithIcon { * Must not hold the Context. */ public AppInfo(Context context, LauncherActivityInfo info, UserHandle user) { - this(context, info, user, UserManagerCompat.getInstance(context).isQuietModeEnabled(user)); + this(info, user, UserManagerCompat.getInstance(context).isQuietModeEnabled(user)); } - public AppInfo(Context context, LauncherActivityInfo info, UserHandle user, - boolean quietModeEnabled) { + public AppInfo(LauncherActivityInfo info, UserHandle user, boolean quietModeEnabled) { this.componentName = info.getComponentName(); this.container = ItemInfo.NO_ID; this.user = user; @@ -71,7 +70,7 @@ public class AppInfo extends ItemInfoWithIcon { isDisabled |= ShortcutInfo.FLAG_DISABLED_QUIET_USER; } - intent = makeLaunchIntent(context, info, user); + intent = makeLaunchIntent(info); } public AppInfo(AppInfo info) { @@ -95,14 +94,11 @@ public class AppInfo extends ItemInfoWithIcon { return new ComponentKey(componentName, user); } - public static Intent makeLaunchIntent(Context context, LauncherActivityInfo info, - UserHandle user) { - long serialNumber = UserManagerCompat.getInstance(context).getSerialNumberForUser(user); + public static Intent makeLaunchIntent(LauncherActivityInfo info) { return new Intent(Intent.ACTION_MAIN) .addCategory(Intent.CATEGORY_LAUNCHER) .setComponent(info.getComponentName()) - .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED) - .putExtra(EXTRA_PROFILE, serialNumber); + .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); } @Override |