Package org.robolectric.shadows
Class ShadowPackageInstaller
java.lang.Object
org.robolectric.shadows.ShadowPackageInstaller
@Implements(value=android.content.pm.PackageInstaller.class, minSdk=21) public class ShadowPackageInstaller extends Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ShadowPackageInstaller.ShadowSession
-
Constructor Summary
Constructors Constructor Description ShadowPackageInstaller()
-
Method Summary
Modifier and Type Method Description protected void
abandonSession(int sessionId)
protected int
createSession(PackageInstaller.SessionParams params)
protected List<PackageInstaller.SessionInfo>
getAllSessions()
protected List<PackageInstaller.SessionInfo>
getMySessions()
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.
-
Constructor Details
-
ShadowPackageInstaller
public ShadowPackageInstaller()
-
-
Method Details
-
getAllSessions
-
getMySessions
-
registerSessionCallback
@Implementation protected void registerSessionCallback(PackageInstaller.SessionCallback callback, Handler handler) -
getSessionInfo
-
createSession
@Implementation protected int createSession(PackageInstaller.SessionParams params) throws IOException- Throws:
IOException
-
abandonSession
-
openSession
- Throws:
IOException
-
setSessionProgress
public void setSessionProgress(int sessionId, float progress) -
setSessionSucceeds
Deprecated.Prefer instead to use the Android APIs to close the sessionPackageInstaller.Session.commit(IntentSender)
-
setSessionFails
public void setSessionFails(int sessionId)
-