Adding install reason when installing an apk

Since the installation involves a user visible UI, set the
appropriate reason. This ensures that the app icon is added
on the homescreen.

Test: Installed an apk using the files app
Bug: 65473379
Change-Id: I5032e31fc7615a63c2630687bc81e663f2286d59
This commit is contained in:
Sunny Goyal
2018-09-19 17:15:25 -07:00
parent c95add6ddc
commit 70d5dd439d

View File

@@ -137,6 +137,7 @@ public class InstallInstalling extends AlertActivity {
UID_UNKNOWN);
params.installerPackageName =
getIntent().getStringExtra(Intent.EXTRA_INSTALLER_PACKAGE_NAME);
params.installReason = PackageManager.INSTALL_REASON_USER;
File file = new File(mPackageURI.getPath());
try {