Added in API level 21

PackageInstaller.Session


public static class PackageInstaller.Session
extends Object implements Closeable

java.lang.Object
   ↳ android.content.pm.PackageInstaller.Session


An installation that is being actively staged. For an install to succeed, all existing and new packages must have identical package names, version codes, and signing certificates.

A session may contain any number of split packages. If the application does not yet exist, this session must include a base package.

If an APK included in this session is already defined by the existing installation (for example, the same split name), the APK in this session will replace the existing APK.

In such a case that multiple packages need to be committed simultaneously, multiple sessions can be referenced by a single multi-package session. This session is created with no package name and calling SessionParams.setMultiPackage(). The individual session IDs can be added with addChildSessionId(int) and commit of the multi-package session will result in all child sessions being committed atomically.

Summary