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
Shadow for PackageInstaller.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
Shadow for PackageInstaller.SessionInfo. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
abandonSession
(int sessionId) protected int
protected List<PackageInstaller.SessionInfo>
protected List<PackageInstaller.SessionInfo>
protected PackageInstaller.SessionInfo
getSessionInfo
(int sessionId) protected PackageInstaller.Session
openSession
(int sessionId) protected void
registerSessionCallback
(PackageInstaller.SessionCallback callback, Handler handler) void
setSessionActiveState
(int sessionId, boolean active) void
setSessionFails
(int sessionId) void
setSessionProgress
(int sessionId, float progress) void
setSessionSucceeds
(int sessionId) Deprecated.protected void
protected void
updateSessionAppIcon
(int sessionId, Bitmap appIcon) protected void
updateSessionAppLabel
(int sessionId, CharSequence appLabel)
-
Constructor Details
-
ShadowPackageInstaller
public ShadowPackageInstaller()
-
-
Method Details
-
getAllSessions
-
getMySessions
-
registerSessionCallback
@Implementation protected void registerSessionCallback(PackageInstaller.SessionCallback callback, Handler handler) -
unregisterSessionCallback
-
getSessionInfo
-
createSession
@Implementation protected int createSession(PackageInstaller.SessionParams params) throws IOException - Throws:
IOException
-
abandonSession
-
openSession
- Throws:
IOException
-
updateSessionAppIcon
-
updateSessionAppLabel
-
getAllSessionCallbacks
-
setSessionProgress
public void setSessionProgress(int sessionId, float progress) -
setSessionActiveState
public void setSessionActiveState(int sessionId, boolean active) -
setSessionSucceeds
Deprecated.Prefer instead to use the Android APIs to close the sessionPackageInstaller.Session.commit(IntentSender)
-
setSessionFails
public void setSessionFails(int sessionId)
-