0

I am working on an Android app to install few other apps. I am using PackageInstaller to install apps and everything is working fine. Sample code how I am installing other apps

PackageInstaller.SessionParams sessionParams = new PackageInstaller.SessionParams(
                    PackageInstaller.SessionParams.MODE_FULL_INSTALL);
sessionParams.setInstallLocation(someInstallLocation);
sessionParams.setAppPackageName(somePackageName);

sessionId = packageInstaller.createSession(sessionParams);
session = packageInstaller.openSession(sessionId);
copyApkToPackageInstaller(session);
session.commit(callbackIntent);

I am defining the timeout after which I would abandon the install If I don't get any callback. For this, I need to understand what happens if I submit installations for two apps one after the other. Will the second one wait until the first one gets completed? or Will Android processes both installs simultaneously?

Assume that user would click "Install" in the PackageInstallerActivity as soon as it appears.

  • Don't have the solution for you, but Android is open source, so you can just look at the code and find out https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/java/android/content/pm/PackageInstaller.java?q=PackageInstaller&ss=android%2Fplatform%2Fsuperproject – Rick Sanchez Sep 07 '20 at 19:23
  • @RickSanchez Thank for your comment. I went through the code but few things I felt really complex. So I thought if someone already has an idea, it would be helpful. – Surya Prakash Reddy Sep 08 '20 at 03:49

0 Answers0