@Implements(value=android.content.ContextWrapper.class) public class ShadowContextWrapper extends Object
| Constructor and Description |
|---|
ShadowContextWrapper() |
| Modifier and Type | Method and Description |
|---|---|
void |
clearNextStartedActivities()
Clears all
Intents started by ContextWrapper.startActivity(android.content.Intent). |
void |
clearStartedServices()
Clears all
Intent started by Context.startService(android.content.Intent). |
void |
denyPermissions(int pid,
int uid,
String... permissions)
Revoke the given permissions for the given process and user.
|
void |
denyPermissions(String... permissionNames)
Revoke the given permissions for the current process and user.
|
List<Intent> |
getBroadcastIntents() |
Intent |
getNextStartedActivity()
Consumes the most recent
Intent started by ContextWrapper.startActivity(android.content.Intent) and returns it. |
Intent |
getNextStartedService()
Consumes the most recent
Intent started by Context.startService(android.content.Intent) and returns it. |
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(int pid,
int uid,
String... permissions)
Grant the given permissions for the given process and user.
|
void |
grantPermissions(String... permissionNames)
Grant the given permissions for the current process and user.
|
Intent |
peekNextStartedActivity()
Returns the most recent
Intent started by ContextWrapper.startActivity(android.content.Intent) without consuming it. |
Intent |
peekNextStartedService()
Returns the most recent
Intent started by Context.startService(android.content.Intent) without consuming it. |
void |
removeSystemService(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 Intent getNextStartedActivity()
Consumes the most recent Intent started by ContextWrapper.startActivity(android.content.Intent) and returns it.
Intentpublic Intent peekNextStartedActivity()
Returns the most recent Intent started by ContextWrapper.startActivity(android.content.Intent) without consuming it.
Intentpublic void clearNextStartedActivities()
Clears all Intents started by ContextWrapper.startActivity(android.content.Intent).
public Intent getNextStartedService()
Consumes the most recent Intent started by Context.startService(android.content.Intent) and returns it.
Intentpublic Intent peekNextStartedService()
Returns the most recent Intent started by Context.startService(android.content.Intent) without consuming it.
Intentpublic void clearStartedServices()
Clears all Intent started by Context.startService(android.content.Intent).
public 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(String... permissionNames)
Grant the given permissions for the current process and user.
public void grantPermissions(int pid,
int uid,
String... permissions)
Grant the given permissions for the given process and user.
public void denyPermissions(String... permissionNames)
Revoke the given permissions for the current process and user.
Has no effect if permissions were not previously granted.
public void denyPermissions(int pid,
int uid,
String... permissions)
Revoke the given permissions for the given process and user.
public void removeSystemService(String name)
Makes Context.getSystemService(String) return null for the given system service name, mimicking a device that doesn’t have that system service.