Parallel Installation in Android using PackageInstaller

212 views Asked by At

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.

0

There are 0 answers