@Implements(value=android.content.ContextWrapper.class) public class ShadowContextWrapper extends java.lang.Object
Constructor and Description |
---|
ShadowContextWrapper() |
Modifier and Type | Method and Description |
---|---|
void |
clearNextStartedActivities()
Clears all
Intent s started by ContextWrapper.startActivity(android.content.Intent) . |
void |
clearStartedServices()
Clears all
Intent started by Context.startService(android.content.Intent) . |
void |
denyPermissions(java.lang.String... permissionNames) |
java.util.List<android.content.Intent> |
getBroadcastIntents() |
android.content.Intent |
getNextStartedActivity()
Consumes the most recent
Intent started by ContextWrapper.startActivity(android.content.Intent) and returns it. |
android.content.Intent |
getNextStartedService()
Consumes the most recent
Intent started by Context.startService(android.content.Intent) and returns it. |
android.content.Intent |
getNextStoppedService()
Consumes the
Intent requested to stop a service by Context.stopService(android.content.Intent) from the bottom of the stack of stop requests. |
void |
grantPermissions(java.lang.String... permissionNames) |
android.content.Intent |
peekNextStartedActivity()
Returns the most recent
Intent started by ContextWrapper.startActivity(android.content.Intent) without consuming it. |
android.content.Intent |
peekNextStartedService()
Returns the most recent
Intent started by Context.startService(android.content.Intent) without consuming it. |
void |
removeSystemService(java.lang.String name)
Makes
Context.getSystemService(String) return null for the given system service name, mimicking a device that doesn’t have that system service. |
public java.util.List<android.content.Intent> getBroadcastIntents()
public android.content.Intent getNextStartedActivity()
Consumes the most recent Intent
started by ContextWrapper.startActivity(android.content.Intent)
and returns it.
Intent
public android.content.Intent peekNextStartedActivity()
Returns the most recent Intent
started by ContextWrapper.startActivity(android.content.Intent)
without consuming it.
Intent
public void clearNextStartedActivities()
Clears all Intent
s started by ContextWrapper.startActivity(android.content.Intent)
.
public android.content.Intent getNextStartedService()
Consumes the most recent Intent
started by Context.startService(android.content.Intent)
and returns it.
Intent
public android.content.Intent peekNextStartedService()
Returns the most recent Intent
started by Context.startService(android.content.Intent)
without consuming it.
Intent
public void clearStartedServices()
Clears all Intent
started by Context.startService(android.content.Intent)
.
public android.content.Intent getNextStoppedService()
Consumes the Intent
requested to stop a service by Context.stopService(android.content.Intent)
from the bottom of the stack of stop requests.
public void grantPermissions(java.lang.String... permissionNames)
public void denyPermissions(java.lang.String... permissionNames)
public void removeSystemService(java.lang.String name)
Makes Context.getSystemService(String)
return null
for the given system service name, mimicking a device that doesn’t have that system service.