Preventing installed PS apps from moving to home screen

During app install in PS, promise app icons and the
installed app icons are added automatically on home screen.
In this change we restrict the same.
Also, checked that enabling `PROMISE_APP_IN_ALL_APPS` still
works for PS apps after this change.

Bug: 325057835
Test: Launcher3 tests
Flag: ACONFIG com.android.launcher3.Flags.private_space_restrict_item_drag TEAMFOOD
Change-Id: Iecff850bcc1cd17a123553a4258943da1ee61fcc
This commit is contained in:
Himanshu Gupta
2024-02-15 20:00:33 +00:00
parent 772e0127c3
commit 4499fa60f9
2 changed files with 16 additions and 4 deletions
@@ -211,7 +211,8 @@ public class InstallSessionHelper {
*/
@WorkerThread
void tryQueuePromiseAppIcon(@Nullable final PackageInstaller.SessionInfo sessionInfo) {
if (SessionCommitReceiver.isEnabled(mAppContext)
if (sessionInfo != null
&& SessionCommitReceiver.isEnabled(mAppContext, getUserHandle(sessionInfo))
&& verifySessionInfo(sessionInfo)
&& !promiseIconAddedForId(sessionInfo.getSessionId())) {
FileLog.d(LOG, "Adding package name to install queue: "