@Implements(value=android.content.pm.PackageInstaller.class, minSdk=21) public class ShadowPackageInstaller extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ShadowPackageInstaller.ShadowSession |
Constructor and Description |
---|
ShadowPackageInstaller() |
Modifier and Type | Method and Description |
---|---|
protected void |
abandonSession(int sessionId) |
protected int |
createSession(PackageInstaller.SessionParams params) |
protected List<PackageInstaller.SessionInfo> |
getAllSessions() |
protected PackageInstaller.SessionInfo |
getSessionInfo(int sessionId) |
protected PackageInstaller.Session |
openSession(int sessionId) |
protected void |
registerSessionCallback(PackageInstaller.SessionCallback callback,
Handler handler) |
void |
setSessionFails(int sessionId) |
void |
setSessionProgress(int sessionId,
float progress) |
void |
setSessionSucceeds(int sessionId)
Deprecated.
|
@Implementation protected List<PackageInstaller.SessionInfo> getAllSessions()
@Implementation protected void registerSessionCallback(PackageInstaller.SessionCallback callback, Handler handler)
@Implementation protected PackageInstaller.SessionInfo getSessionInfo(int sessionId)
@Implementation protected int createSession(PackageInstaller.SessionParams params) throws IOException
IOException
@Implementation protected void abandonSession(int sessionId)
@Implementation protected PackageInstaller.Session openSession(int sessionId) throws IOException
IOException
public void setSessionProgress(int sessionId, float progress)
@Deprecated public void setSessionSucceeds(int sessionId)
Prefer instead to use the Android APIs to close the session PackageInstaller.Session.commit(IntentSender)
public void setSessionFails(int sessionId)