mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-02-19 15:48:19 -05:00
SessionInstaller: Set install reason as user
This fixes that new installed app isn't being added to
homescreen.
Launcher3 checks the install reason of the new app install
and if it's only INSTALL_REASON_USER, then app icon will be
added to homescreen. [0]
Reference:
0 - fb0952266e/src/com/android/launcher3/pm/InstallSessionHelper.java (237)
This commit is contained in:
@@ -121,6 +121,9 @@ public class SessionInstallManager extends BroadcastReceiver {
|
||||
params.setAppPackageName(app.packageName);
|
||||
params.setSize(size);
|
||||
params.setInstallLocation(PackageInfo.INSTALL_LOCATION_AUTO);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
params.setInstallReason(PackageManager.INSTALL_REASON_USER);
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 31) {
|
||||
params.setRequireUserAction(PackageInstaller.SessionParams.USER_ACTION_NOT_REQUIRED);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user