mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
Automatically adding managed profile shortcuts to homescreen.
When the managed profile is created, a "Work" folder is created and added to the homescreen. All work profile apps are added to this folder and icons for subsequent installs (withing a fixed time frame) are automatically added to this folder. If this folder get deleted or the time-frame expires, icon for any new install is placed on the homescreen. Bug: 17410319 Change-Id: I49f4e437707d5eabe4eec85320765bf6ba7fde97
This commit is contained in:
@@ -210,7 +210,7 @@ public class InstallShortcutReceiver extends BroadcastReceiver {
|
||||
// Add the new apps to the model and bind them
|
||||
if (!addShortcuts.isEmpty()) {
|
||||
LauncherAppState app = LauncherAppState.getInstance();
|
||||
app.getModel().addAndBindAddedWorkspaceApps(context, addShortcuts);
|
||||
app.getModel().addAndBindAddedWorkspaceItems(context, addShortcuts);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -352,16 +352,7 @@ public class InstallShortcutReceiver extends BroadcastReceiver {
|
||||
|
||||
public ShortcutInfo getShortcutInfo() {
|
||||
if (activityInfo != null) {
|
||||
final ShortcutInfo info = new ShortcutInfo();
|
||||
info.user = user;
|
||||
info.title = label;
|
||||
info.contentDescription = label;
|
||||
info.customIcon = false;
|
||||
info.intent = launchIntent;
|
||||
info.itemType = LauncherSettings.Favorites.ITEM_TYPE_APPLICATION;
|
||||
info.flags = AppInfo.initFlags(activityInfo);
|
||||
info.firstInstallTime = activityInfo.getFirstInstallTime();
|
||||
return info;
|
||||
return ShortcutInfo.fromActivityInfo(activityInfo, mContext);
|
||||
} else {
|
||||
return LauncherAppState.getInstance().getModel().infoFromShortcutIntent(mContext, data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user