@Implements(value=android.app.role.RoleManager.class, minSdk=29) public class ShadowRoleManager extends Object
RoleManager
.Modifier and Type | Field | Description |
---|---|---|
protected RoleManager |
roleManager |
Constructor | Description |
---|---|
ShadowRoleManager() |
Modifier and Type | Method | Description |
---|---|---|
void |
addHeldRole(String roleName) |
Add a role that would be held by the calling app when invoking
RoleManager.isRoleHeld(String) . |
boolean |
isRoleHeld(String roleName) |
Check whether the calling application is holding a particular role.
|
void |
removeHeldRole(String roleName) |
@RealObject protected RoleManager roleManager
@Implementation public boolean isRoleHeld(@NonNull String roleName)
Callers can add held roles via addHeldRole(String)
roleName
- the name of the role to check forpublic void addHeldRole(@NonNull String roleName)
RoleManager.isRoleHeld(String)
.public void removeHeldRole(@NonNull String roleName)