Fixed
Status Update
Comments
jo...@gmail.com <jo...@gmail.com> #2
I believe this is for the shim library but it's unclear who the new owner is now, so please triage and reassign.
vi...@google.com <vi...@google.com>
vi...@google.com <vi...@google.com> #3
Thank you for reporting this issue. We have shared this with our product and engineering team and will update this issue with more information as it becomes available.
vi...@google.com <vi...@google.com> #4
Response from engineering team :
=============================
Just tested this out usinghttps://android.googlesource.com/platform/development/+/master/samples/ApiDemos/src/com/example/android/apis/content/InstallApkSessionApi.java and it seems to be WAI
External developer says that they use INSTALL_REASON_USER, but launcher also requires the app package name to be set as well (PackageInstaller.SessionParams#setAppPackageName) so that's what they may be missing.
=============================
Just tested this out using
External developer says that they use INSTALL_REASON_USER, but launcher also requires the app package name to be set as well (PackageInstaller.SessionParams#setAppPackageName) so that's what they may be missing.
lb...@gmail.com <lb...@gmail.com> #5
@4 Since the app was installed, it can be queried so that package name is not really needed.
Please remove this requirement.
Installing an APK doesn't always mean you know which package name is inside of it (think about InputStream of an APK).
Also, the docs don't say it's a requirement. The opposite. It says it's optional:
https://developer.android.com/reference/android/content/pm/PackageInstaller.SessionParams#setAppPackageName(java.lang.String)
"Optionally set the package name of the app being installed."
It doesn't say anything about INSTALL_REASON_USER requiring it either:
https://developer.android.com/reference/android/content/pm/PackageManager#INSTALL_REASON_USER
And, according to what I was told by you guys, it isn't supposed to be required to have package name being provided when using INSTALL_REASON_USER. I requested the requirement of having the package name to be removed, and you said it's already not needed for INSTALL_REASON_USER :
https://issuetracker.google.com/issues/157783076#comment3
In fact, you guys told me that it's not package name that's needed, but label (which is wrong) :
https://issuetracker.google.com/issues/153223644#comment6
In any case, please re-consider removing the requirement. It doesn't make sense that after the app got installed, it still needs a package name from outside instead of just checking the APK itself. It could even get the package name while installing, and I'm sure it already does, because if we provide it with multiple APK files, it will fail in case the package names of them don't match each other.
Please remove this requirement.
Installing an APK doesn't always mean you know which package name is inside of it (think about InputStream of an APK).
Also, the docs don't say it's a requirement. The opposite. It says it's optional:
"Optionally set the package name of the app being installed."
It doesn't say anything about INSTALL_REASON_USER requiring it either:
And, according to what I was told by you guys, it isn't supposed to be required to have package name being provided when using INSTALL_REASON_USER. I requested the requirement of having the package name to be removed, and you said it's already not needed for INSTALL_REASON_USER :
In fact, you guys told me that it's not package name that's needed, but label (which is wrong) :
In any case, please re-consider removing the requirement. It doesn't make sense that after the app got installed, it still needs a package name from outside instead of just checking the APK itself. It could even get the package name while installing, and I'm sure it already does, because if we provide it with multiple APK files, it will fail in case the package names of them don't match each other.
cc...@google.com <cc...@google.com>
vi...@google.com <vi...@google.com> #6
The development team has fixed the issue that you have reported and it will be available in a future build.
lb...@gmail.com <lb...@gmail.com> #7
@6 Can you please explain further?
Will this be available for both adb and the framework API itself?
Meaning that I won't have to specify the package name at all?
And will it be possible for both old and new Android versions? Or just newer version of Android?
Will this be available for both adb and the framework API itself?
Meaning that I won't have to specify the package name at all?
And will it be possible for both old and new Android versions? Or just newer version of Android?
Description
- Steps to reproduce the problem (including sample code if appropriate).
0. Put the files I've attached here into device/emulator, of aplit APK file (" Inware_com,evo,inware_2,0,4.apks", which is a zip of APK files) and " sample v1.apk" (which is a simple stand alone APK file)
1. Create an app that will install another app using sessions, and compare to via Intent.
2. For the SessionParams instance, use this:
params.setInstallReason(PackageManager.INSTALL_REASON_USER)
3. Run your app to install using it. You can cause it to open the
- What happened.
It gets installed, but as opposed to the Play Store (and as opposed to doing it for a normal APK), it doesn't put a shortcut on the launcher.
- What you think the correct behavior should be.
Should put a shortcut just like doing it via Intent.