summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2014-11-21 01:01:00 (GMT)
committerDanesh M <daneshm90@gmail.com>2015-09-28 04:07:40 (GMT)
commit75942b19070d6816e528813d77fab435adc5fa3c (patch)
tree59012cc1a09278f155050ab80172388307f9ecd3
parent9638173e370a1f0e425f19e939cbf042cb400968 (diff)
downloadandroid_packages_apps_Trebuchet-75942b19070d6816e528813d77fab435adc5fa3c.zip
android_packages_apps_Trebuchet-75942b19070d6816e528813d77fab435adc5fa3c.tar.gz
android_packages_apps_Trebuchet-75942b19070d6816e528813d77fab435adc5fa3c.tar.bz2
Disabling auto addition of managed profile shortcuts
Bug: 16188104 Change-Id: Ib6464c22140df6d60112eb35f5983718b3db6288
-rw-r--r--src/com/android/launcher3/LauncherModel.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index f3da7c4..dae2c18 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -90,6 +90,7 @@ public class LauncherModel extends BroadcastReceiver
static final boolean DEBUG_LOADERS = false;
private static final boolean DEBUG_RECEIVER = false;
private static final boolean REMOVE_UNRESTORED_ICONS = true;
+ private static final boolean ADD_MANAGED_PROFILE_SHORTCUTS = false;
static final String TAG = "Launcher.Model";
public static final String SETTINGS_PROTECTED_COMPONENTS = "protected_components";
@@ -3185,7 +3186,7 @@ public class LauncherModel extends BroadcastReceiver
mBgAllAppsList.add(new AppInfo(mContext, app, user, mIconCache, mLabelCache));
}
- if (!user.equals(UserHandleCompat.myUserHandle())) {
+ if (ADD_MANAGED_PROFILE_SHORTCUTS && !user.equals(UserHandleCompat.myUserHandle())) {
// Add shortcuts for packages which were installed while launcher was dead.
String shortcutsSetKey = INSTALLED_SHORTCUTS_SET_PREFIX
+ mUserManager.getSerialNumberForUser(user);
@@ -3377,7 +3378,8 @@ public class LauncherModel extends BroadcastReceiver
}
// Auto add shortcuts for added packages.
- if (!UserHandleCompat.myUserHandle().equals(mUser)) {
+ if (ADD_MANAGED_PROFILE_SHORTCUTS
+ && !UserHandleCompat.myUserHandle().equals(mUser)) {
SharedPreferences prefs = context.getSharedPreferences(
LauncherAppState.getSharedPreferencesKey(), Context.MODE_PRIVATE);
String shortcutsSetKey = INSTALLED_SHORTCUTS_SET_PREFIX
@@ -3411,7 +3413,8 @@ public class LauncherModel extends BroadcastReceiver
case OP_REMOVE:
// Remove the packageName for the set of auto-installed shortcuts. This
// will ensure that the shortcut when the app is installed again.
- if (!UserHandleCompat.myUserHandle().equals(mUser)) {
+ if (ADD_MANAGED_PROFILE_SHORTCUTS
+ && !UserHandleCompat.myUserHandle().equals(mUser)) {
SharedPreferences prefs = context.getSharedPreferences(
LauncherAppState.getSharedPreferencesKey(), Context.MODE_PRIVATE);
String shortcutsSetKey = INSTALLED_SHORTCUTS_SET_PREFIX