mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-18 18:28:20 +00:00
Add support for work profile promise icons.
- We were not getting callbacks for sessions created under work profile. - We did not pass in the user when creating the workspace item infos. - Added check for if app is installed before adding item to workspace to prevent any stale promise icons. This seems to happen when uninstalling and then immediately reinstalling an application. Bug: 141556707 Change-Id: Ie0320f3ede70b6c7543cb60c3b95a2fe398eecb5 Merged-In: I2db2d8da449c37eb248a59fbc9e7b517f50855c1
This commit is contained in:
committed by
Jonathan Miranda
parent
ec72bf63df
commit
7c76a33243
@@ -117,25 +117,30 @@ public class AddWorkspaceItemsTask extends BaseModelUpdateTask {
|
||||
}
|
||||
SessionInfo sessionInfo = packageInstaller.getActiveSessionInfo(item.user,
|
||||
packageName);
|
||||
List<LauncherActivityInfo> activities = launcherApps
|
||||
.getActivityList(packageName, item.user);
|
||||
boolean hasActivity = activities != null && !activities.isEmpty();
|
||||
|
||||
if (sessionInfo == null) {
|
||||
List<LauncherActivityInfo> activities = launcherApps
|
||||
.getActivityList(packageName, item.user);
|
||||
if (activities != null && !activities.isEmpty()) {
|
||||
// App was installed while launcher was in the background.
|
||||
itemInfo = new AppInfo(app.getContext(), activities.get(0), item.user)
|
||||
.makeWorkspaceItem();
|
||||
WorkspaceItemInfo wii = (WorkspaceItemInfo) itemInfo;
|
||||
wii.title = "";
|
||||
wii.applyFrom(app.getIconCache().getDefaultIcon(item.user));
|
||||
app.getIconCache().getTitleAndIcon(wii,
|
||||
((WorkspaceItemInfo) itemInfo).usingLowResIcon());
|
||||
} else {
|
||||
if (!hasActivity) {
|
||||
// Session was cancelled, do not add.
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
workspaceInfo.setInstallProgress((int) sessionInfo.getProgress());
|
||||
}
|
||||
|
||||
if (hasActivity) {
|
||||
// App was installed while launcher was in the background,
|
||||
// or app was already installed for another user.
|
||||
itemInfo = new AppInfo(app.getContext(), activities.get(0), item.user)
|
||||
.makeWorkspaceItem();
|
||||
WorkspaceItemInfo wii = (WorkspaceItemInfo) itemInfo;
|
||||
wii.title = "";
|
||||
wii.applyFrom(app.getIconCache().getDefaultIcon(item.user));
|
||||
app.getIconCache().getTitleAndIcon(wii,
|
||||
((WorkspaceItemInfo) itemInfo).usingLowResIcon());
|
||||
}
|
||||
}
|
||||
|
||||
// Add the shortcut to the db
|
||||
|
||||
Reference in New Issue
Block a user